[pypy-svn] r30355 - pypy/dist/pypy/module/mmap

rhymes at codespeak.net rhymes at codespeak.net
Sat Jul 22 15:33:31 CEST 2006


Author: rhymes
Date: Sat Jul 22 15:33:29 2006
New Revision: 30355

Modified:
   pypy/dist/pypy/module/mmap/interp_mmap.py
Log:
the size should be increased too. otherwise the final part is not "msynced"


Modified: pypy/dist/pypy/module/mmap/interp_mmap.py
==============================================================================
--- pypy/dist/pypy/module/mmap/interp_mmap.py	(original)
+++ pypy/dist/pypy/module/mmap/interp_mmap.py	Sat Jul 22 15:33:29 2006
@@ -388,7 +388,10 @@
                     # alignment of the address
                     value = pythonapi.PyLong_FromVoidPtr(data)
                     aligned_value = value & ~(PAGESIZE - 1)
-                    res = linux_msync(c_void_p(aligned_value), size, MS_SYNC)
+                    # the size should be increased too. otherwise the final
+                    # part is not "msynced"
+                    new_size = size + value & (PAGESIZE - 1)
+                    res = linux_msync(c_void_p(aligned_value), new_size, MS_SYNC)
                 else:
                     res = libc.msync(data, size, MS_SYNC)
                 if res == -1:



More information about the Pypy-commit mailing list