3 ms·
When you free() a memory region, it's not returned to the OS. It's only made available for later mallocs. When malloc returns memory previously freed by the pr
by fooyc 15y ago
When you free() a memory region, it's not returned to the OS. It's only made available for later mallocs.
When malloc returns memory previously freed by the process, it effectively returns uninitialized memory, without leaking any information that's not already known to the calling process.
- aidenn0 15y agoThis depends on the implementation. There are implementations that always unmamp freed memory to catch use after free errors (I think there is a BSD that uses this by default)