diff options
-rw-r--r-- | pypy/__init__.py | 15 | ||||
-rw-r--r-- | pypy/rlib/rmmap.py | 13 | ||||
-rw-r--r-- | pypy/rpython/module/ll_time.py | 4 | ||||
-rwxr-xr-x | pytest.py | 14 |
4 files changed, 42 insertions, 4 deletions
diff --git a/pypy/__init__.py b/pypy/__init__.py index b7db25411d..4437e12818 100644 --- a/pypy/__init__.py +++ b/pypy/__init__.py @@ -1 +1,16 @@ # Empty + +# XXX Should be empty again, soon. +# XXX hack for win64: +# This patch must stay here until the END OF STAGE 1 +# When all tests work, this branch will be merged +# and the branch stage 2 is started, where we remove this patch. +import sys +if hasattr(sys, "maxsize"): + if sys.maxint <> sys.maxsize: + sys.maxint = sys.maxsize + import warnings + warnings.warn("""\n +---> This win64 port is now in stage 1: sys.maxint was modified. +---> When pypy/__init__.py becomes empty again, we have reached stage 2. +""") diff --git a/pypy/rlib/rmmap.py b/pypy/rlib/rmmap.py index 1da749741d..2d39db9a81 100644 --- a/pypy/rlib/rmmap.py +++ b/pypy/rlib/rmmap.py @@ -226,6 +226,7 @@ elif _MS_WINDOWS: # XXX should be propagate the real type, allowing # for 2*sys.maxint? high = high_ref[0] + high = rffi.cast(lltype.Signed, high) # low might just happen to have the value INVALID_FILE_SIZE # so we need to check the last error also INVALID_FILE_SIZE = -1 @@ -548,7 +549,7 @@ class MMap(object): FILE_BEGIN = 0 high_ref = lltype.malloc(PLONG.TO, 1, flavor='raw') try: - high_ref[0] = newsize_high + high_ref[0] = rffi.cast(LONG, newsize_high) SetFilePointer(self.file_handle, newsize_low, high_ref, FILE_BEGIN) finally: @@ -710,7 +711,9 @@ if _POSIX: free = c_munmap_safe elif _MS_WINDOWS: - def mmap(fileno, length, tagname="", access=_ACCESS_DEFAULT, offset=0): + def mmap(fileno, length, flags=0, tagname="", access=_ACCESS_DEFAULT, offset=0): + # XXX flags is or-ed into access by now. + # check size boundaries _check_map_size(length) map_size = length @@ -792,6 +795,7 @@ elif _MS_WINDOWS: offset_hi = 0 offset_lo = offset + flProtect |= flags m.map_handle = CreateFileMapping(m.file_handle, NULL, flProtect, size_hi, size_lo, m.tagname) @@ -809,6 +813,11 @@ elif _MS_WINDOWS: m.map_handle = INVALID_HANDLE raise winerror + class Hint: + pos = -0x4fff0000 # for reproducible results + hint = Hint() + # XXX this has no effect on windows + def alloc(map_size): """Allocate memory. This is intended to be used by the JIT, so the memory has the executable bit set. diff --git a/pypy/rpython/module/ll_time.py b/pypy/rpython/module/ll_time.py index d0cab82fee..e2687b09e9 100644 --- a/pypy/rpython/module/ll_time.py +++ b/pypy/rpython/module/ll_time.py @@ -9,7 +9,7 @@ from pypy.rpython.tool import rffi_platform as platform from pypy.rpython.lltypesystem import lltype from pypy.rpython.extfunc import BaseLazyRegistering, registering, extdef from pypy.rlib import rposix -from pypy.rlib.rarithmetic import intmask +from pypy.rlib.rarithmetic import intmask, maxint32 from pypy.translator.tool.cbuild import ExternalCompilationInfo if sys.platform == 'win32': @@ -177,7 +177,7 @@ class RegisterTime(BaseLazyRegistering): @registering(time.sleep) def register_time_sleep(self): if sys.platform == 'win32': - MAX = sys.maxint + MAX = maxint32 Sleep = self.llexternal('Sleep', [rffi.ULONG], lltype.Void) def time_sleep_llimpl(secs): millisecs = secs * 1000.0 @@ -4,6 +4,20 @@ unit and functional testing with Python. """ __all__ = ['main'] +# XXX hack for win64: +# This patch must stay here until the END OF STAGE 1 +# When all tests work, this branch will be merged +# and the branch stage 2 is started, where we remove this patch. +import sys +if hasattr(sys, "maxsize"): + if sys.maxint <> sys.maxsize: + sys.maxint = sys.maxsize + import warnings + warnings.warn("""\n +---> This win64 port is now in stage 1: sys.maxint was modified. +---> When pypy/__init__.py becomes empty again, we have reached stage 2. +""") + from _pytest.core import main, UsageError, _preloadplugins from _pytest import core as cmdline from _pytest import __version__ |