Other Parts Discussed in Thread: SYSBIOS
Tool/software: TI-RTOS
Hello!
We are developing a system on C6670. At certain point of the development we realized we need to have multiple heaps. Before that malloc() and free() were conveniently routed to their actual implementations, and developers did not bother about that. Now as we wish more than default heap we need to use some other API.
As I understood, what was MEM_alloc and MEM_free in DSP/BIOS now is superseded by Memory_alloc and Memory_free of SYSBIOS.
I know how to create other heap through configuration script. What I wonder is what is intended usage of Memory_alloc and Memory_free. With the former things are relatively clear, heap handle, block size and alignment all looks relevant and reasonable. What makes me stuck is intended usage of Memory free. I could understand passing heap handle argument explicitly, but why this API requires explicit specification of the block size to free? People used to malloc() rarely keep track of block sizes were requested. Does it mean, that using multiple heaps, and hence using Memory_free one have to keep records of blocks were allocated?
Of course, I know that right before the pointer returned there is "hidden" record about this allocation and peeping there I could find the block size. However, I have a feeling that was not intended usage of API.
I understand the question I am asking is very lame and basic, but please direct me to some guideline or example of practical usage of Memory_free().
Thanks in advance.