[Monetdb-developers] mmap region resizing
26 Jan
2010
26 Jan
'10
2:59 a.m.
While figuring out some things related to memory management, I stumbled upon a line in MonetDB/src/gdk/gdk_posix.mx which I don't fully understand:
munmap(p + oldsize, oldsize - newsize);
..which is called from MT_vmrealloc when the old size is larger than the new size. This would unmap a region as large as the size difference between both sizes, but after the currently mapped region [p; p + oldsize[ (which is probably not mapped, or is mapped to something unrelated). The attached patch changes this behavior so the resulting mapped region will be [p; p + newsize[, with the now unneeded [p + newsize; p + oldsize[ region being unmapped (which is a behavior I find more intuitive).
Please review and use as it fits.
Best regards,
Isidor Zeuner
5212
Age (days ago)
5212
Last active (days ago)
0 comments
1 participants
participants (1)
-
Isidor Zeuner