[pypy-commit] pypy use-mmap: Make position hinting work on 64-bit too. At least Linux64 doesn't

arigo pypy.commits at gmail.com
Wed Jul 6 14:31:50 EDT 2016


Author: Armin Rigo <arigo at tunes.org>
Branch: use-mmap
Changeset: r85589:638e16f1b0f4
Date: 2016-07-06 20:33 +0200
http://bitbucket.org/pypy/pypy/changeset/638e16f1b0f4/

Log:	Make position hinting work on 64-bit too. At least Linux64 doesn't
	allow negative addresses to be used by processes, so the hint was
	never respected. Now I hope it will be, which would avoid the
	current situation: /proc/../maps shows alternating PROT_EXEC and
	non-PROT_EXEC maps, which can't be merged by the kernel.

diff --git a/rpython/rlib/rmmap.py b/rpython/rlib/rmmap.py
--- a/rpython/rlib/rmmap.py
+++ b/rpython/rlib/rmmap.py
@@ -727,7 +727,10 @@
 
     # XXX is this really necessary?
     class Hint:
-        pos = -0x4fff0000   # for reproducible results
+        if sys.maxint <= 2**32:
+            pos = -0x4fff0000   # for reproducible results
+        else:
+            pos = 0x4fde00000000
     hint = Hint()
 
     def alloc(map_size):


More information about the pypy-commit mailing list