I have been called on to write a "Partial Free" function for previously allocate...

@mcc@mastodon.social

I have been called on to write a "Partial Free" function for previously allocated virtual memory. EG, someone allocated a large block of memory with mmap(), and now they want to free a section *out of the middle or end* of it.

My reading of the POSIX munmap doc pubs.opengroup.org/onlinepubs/ is that munmap does this already, because it deallocates "pages" not previous allocations, and I only need to call munmap() with the requested-deallocated range (assuming the range to be page-aligned)

Correct?