SWRU271I October 2010 – January 2020 CC2540 , CC2540T , CC2541 , CC2541-Q1 , CC2640R2F
Th eOSAL provides basic memory management functions. The osal_mem_alloc() function can allocate memory similarly to the standard C malloc function. The OSAL function takes a single parameter specifying the number of bytes to allocate and returns a void pointer if successful. If memory is unavailable, a NULL pointer is returned.
The osal_mem_free() function frees memory allocated using osal_mem_alloc() similarly to the standard C free function.
The INT_HEAP_LEN preprocessor symbol reserves memory for dynamic allocation.
To profile dynamic memory usage, do the following:
Because the Bluetooth Low Energy stack also uses the heap, you must test it with both components in the maximum-expected operating conditions.