DRNadler / FreeRTOS_helpers

Helpers for some common problems when using FreeRTOS, GCC, and newlib.
140 stars 21 forks source link

Question regarding heapBytesRemaining #17

Closed Jannebozz closed 1 year ago

Jannebozz commented 1 year ago

Perhaps I misunderstood something, or the usage of this... But since heapBytesRemaining never is incremented you will eventually run out of memory after a few calls to malloc. Understand that free does not have any info how large the chunk is.

DRNadler commented 1 year ago

sbrk provides memory => into => the heap. One Way. malloc and family dole out portions of heap memory to an application, free allows the application to return memory to the heap for reuse. Hope that is clear! Best Regards, Dave