The doc[1] says: “heap_4.c is particularly useful for applications that want to use the portable layer memory allocation schemes directly in the application code (rather than just indirectly by calling API functions that themselves call pvPortMalloc() and vPortFree()).”
Is there an example/further explanation somewhere as to how to use this memory allocation scheme without pvPortMalloc() and vPortFree() in application code?
If you need to allocate memory dynamically in your application code and you want that memory to come from heap_4, then you need to call pvPortMalloc. What is the motivation of not calling it?
I thought that I would need to call pvPortMalloc, but "heap_4.c is particularly useful for applications that want to use the portable layer memory allocation schemes directly in the application code (rather than just indirectly by calling API functions that themselves call pvPortMalloc() and vPortFree()).” suggests otherwise.
I think now I’m getting it. The usual methods (vPortMalloc() and vPortFree()) are used, but it’s especially well suited for applications using the direct method (vPortMalloc() and vPortFree()) due to it’s algorithm which combines adjacent free memory blocks…