OK, I didn't know that even if I tried porting to newlib a while ago. The OpenWatcom implementation does not contain any unmapping "hooks" that I know of at least.gerryg400 wrote:Rdos, what on earth are you talking about ?That's not true. Many allocators including the malloc() that I use (from newlib) can munmap memory during free() if the O/S supports it. Most do.few, if any, allocators that grabs a piece of memory will ever be able to return some of it back to the OS, so linear address space that have been comitted for physical storage never free the physical storage.
Still, if memory is not allocated page-aligned, chances are it cannot be unmapped either. That is why malloc should work with page-aligned allocation for reasonably large allocations, and only resort to less for small.