|
|
|
|
|
by flip89
1964 days ago
|
|
I think, this particular part of the design is here for historical reasons. The classic way of allocating memory in Unix systems was heap extension with brk/sbrk calls, so glibc malloc from beginning was designed using these syscalls and logic. So with this mechanism you need to free last allocated object to shrink the heap.
Now, allocators often get new memory from system using mmap syscall and probably have different expectations. |
|