Can I safely delete the entire profile group?

4 posts / 0 new
Last post
brian
Offline
Last seen:6 years 2 months ago
Expert Master
加入:2014-10-16 18:10
Can I safely delete the entire profile group?

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?

brian
Offline
Last seen:6 years 2 months ago
Expert Master
加入:2014-10-16 18:10
To answer my own question the

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.

MHv_Dialog
Offline
Last seen:1 month 3 weeks ago
工作人员
加入:2013-12-06 15:10
There is only one heap

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).

brian
Offline
Last seen:6 years 2 months ago
Expert Master
加入:2014-10-16 18:10
Okay, so all I am saving is

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).