Hello
Using HeapBuf object in my project I found very serious problem with dynamic deletion of dynamically created heap.
Dynamic creation of HeapBuf or HeapMem heaps requires passing of already allocated memory buffer and its size to be used actually by the heap. Passing of these parameters is done by HeapBuf_Params structure fields: 'buf' and 'bufSize' passed to HeapBuf_create() function as the first argument. Until now everything seems to be fine - HeapBuf object is created, visible in SYSBIOS resources and it works. But finally or for some reason when user wants to delete dynamically created heap using HeapBuf_delete() function, then big problem appears: function HeapBuf_delete() of course releases memory used to create instance of heap object but it does NOT release memory buffer passed to the function in HeapBuf_Params structure during construction. It is OK bacause this buffer doesn't have to be dynamically allocated, but if it is, then we have problem bacause HeapBuf and well HeapMem objects does NOT provide functions to get heap buffer parameters from the object, in this way we have no access to this buffer and its size, and cannot release this buffer to proper heap.
and here is my request to TI experts responsible for creation and maintanance of SYSBIOS - please provide a way to release internal heap buffer before deleting heap object. Few methods seems to be ok:
1. Implement Ptr HeapBuf_getBufSize(size_t * pSize);
or alternatively implement Ptr HeapBuf_getBuf(HeapBuf_Handle) and size_t HeapBuf_getBufSize(HeapBuf_Handle)
2. Add 2-nd parameter of IHeap_Handle to HeapBuf_delete() It should be heap used to allocate this buffer before heap creation; if it is not NULL then it should be used to free internal heap buffer
Best regards
Gregor
ps. this problem applies also to HeapMultiBuf object