This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
free() does not call sbrk()
- From: Martin Walter <martin dot walter at gmail dot com>
- To: newlib at sourceware dot org
- Date: Tue, 15 Sep 2009 12:54:32 +0200
- Subject: free() does not call sbrk()
Hello!
I am just testing my port of the newlib-1.17.0 for our architecture
and came across the following issue:
(1) the newlib libc documentation says that free() invokes sbrk() with
a negative incrementer argument, but a simple debug trace reveals that
sbrk() is actually never called by free().
(2) when malloc()'ing and free()'ing chunks of memory in a loop it
seems that memory is actually never free()'d, which might be due to
(1). instead, the heap keeps on growing.
I guess this is not the intended behavior. Any ideas? Thank you!
Cheers,
Martin