I am developing a central exposing no services, and the use of the profiles and applications profiles is very costly; all that is needed is the GAP and GATT level calls. However, even so I am running short on resources. I cannot save the results of a full service discovery for a single device without realloc and calloc failing part way through characteristic discovery. In the effort to free up some resources, I am wondering if I could delete the entire profiles group, or is there some utilities in there that are used by the GAP and GATT level calls?
To answer my own question the answer is yes ... at least so far. Now to figure out how to the areas of memory that have been freed up by their removal; for example put some of my code in the area where these profiles sat.
There is only one heap available, and this is to be accessed thru ke_malloc. Please try that.
Deleting the profiles/services should not free any memory unless the profiles/services are actually being compiled in (compiler switches are preventing this).
Okay, so all I am saving is compilation time when I rebuild the entire project since the profiles group is removed. (They do get compiled even if they are not used.)
That being said are you saying I should not use the realloc and calloc methods? (They DO work for a while ... although not very much memory is allocated using them!) The problem with using ke_malloc is that the memory is freed after sending a message and it appears to be associated only with sending a message (according to the documentation). I am not sending a message and I need to keep that memory until the device is deleted from the system (at which time I DO want to release the resources).