Author: Christian Tismer <[email protected]>
Branch: win64-stage1
Changeset: r49827:5104f75cdb84
Date: 2011-11-26 19:22 +0100
http://bitbucket.org/pypy/pypy/changeset/5104f75cdb84/

Log:    hacked a bit on ll2ctypes/do_allocation_in_far_regions stopped this,
        fijal claims it makes no longer sense

diff --git a/pypy/rpython/lltypesystem/ll2ctypes.py 
b/pypy/rpython/lltypesystem/ll2ctypes.py
--- a/pypy/rpython/lltypesystem/ll2ctypes.py
+++ b/pypy/rpython/lltypesystem/ll2ctypes.py
@@ -14,7 +14,7 @@
 else:
     load_library_kwargs = {}
 
-import os
+import os, platform as host_platform
 from pypy.rpython.lltypesystem import lltype, llmemory
 from pypy.rpython.extfunc import ExtRegistryEntry
 from pypy.rlib.objectmodel import Symbolic, ComputedIntSymbolic
@@ -33,6 +33,12 @@
     class tlsobject(object):
         pass
 
+_POSIX = os.name == "posix"
+_MS_WINDOWS = os.name == "nt"
+_LINUX = "linux" in sys.platform
+_64BIT = "64bit" in host_platform.architecture()[0]
+
+
 # ____________________________________________________________
 
 far_regions = None
@@ -69,17 +75,20 @@
     global far_regions
     if not far_regions:
         from pypy.rlib import rmmap
-        if maxint > 0x7FFFFFFF:
+        if _64BIT:
             PIECESIZE = 0x80000000
         else:
-            if sys.platform == 'linux':
+            if _LINUX:
                 PIECESIZE = 0x10000000
             else:
                 PIECESIZE = 0x08000000
         PIECES = 10
-        m = rmmap.mmap(-1, PIECES * PIECESIZE,
-                       
rmmap.MAP_PRIVATE|rmmap.MAP_ANONYMOUS|rmmap.MAP_NORESERVE,
-                       rmmap.PROT_READ|rmmap.PROT_WRITE)
+        flags = 0
+        if _LINUX:
+            flags = (rmmap.MAP_PRIVATE|rmmap.MAP_ANONYMOUS|rmmap.MAP_NORESERVE,
+                     rmmap.PROT_READ|rmmap.PROT_WRITE)
+            
+        m = rmmap.mmap(-1, PIECES * PIECESIZE, flags)
         m.close = lambda : None    # leak instead of giving a spurious
                                    # error at CPython's shutdown
         m._ll2ctypes_pieces = []
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to