Closed Jannebozz closed 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
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.