I am working on the webkit open source code. I see a small function like this
void TCMalloc_SystemRelease(void* start, size_t length)
{
void* newAddress = mmap(start, length, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, -1, 0);
}
This function TCMalloc_SystemRelease() is supposed to release the memory back to the system, but it is calling mmap() function instead of free or delete. My understanding is that mmap is used to allocate the resources. That is it creates a new mapping in the virtual address space of the calling process.
Please can any one let me know is mmap can be used to release the memory back to the system also.
Sorry if I sound stupid

Please help
Thanks in advance