How can a heap listener be used on the system heap? That is, the system heap that is used for k_malloc() and k_free(), with size set in kconfig as follows. The kconfig to enable the listener is also added
CONFIG_HEAP_MEM_POOL_SIZE=/* size in bytes */ CONFIG_SYS_HEAP_LISTENER=y
In particular, I'm trying to find out what _heap_id should be used with the macros
HEAP_LISTENER_ALLOC_DEFINE(name, _heap_id, _alloc_cb) HEAP_LISTENER_FREE_DEFINE(name, _heap_id, _free_cb)
I tried using "HEAP_ID_LIBC" for the _heap_id in the above listener define macros. It builds, but no calls to the _alloc_cb or _free_cb functions occur, despite many uses of k_malloc() and k_free(). I would assume HEAP_ID_LIBC is for C library calls with malloc() and free(), and not the Zephyr memory pool heap functions k_malloc() and k_free().
What should be used for the heap ID with the heap memory pool? Is there an example of using the heap listener API?
Thank you,
Walt