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 https://pubs.opengroup.org/onlinepubs/7908799/xsh/munmap.html 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?