Author: Armin Rigo <[email protected]>
Branch: asmmemmgr-for-code-only
Changeset: r86253:3342ecf1974e
Date: 2016-08-17 18:09 +0200
http://bitbucket.org/pypy/pypy/changeset/3342ecf1974e/
Log: Fix more tests
diff --git a/rpython/jit/backend/llsupport/assembler.py
b/rpython/jit/backend/llsupport/assembler.py
--- a/rpython/jit/backend/llsupport/assembler.py
+++ b/rpython/jit/backend/llsupport/assembler.py
@@ -190,15 +190,16 @@
track_allocation=False)
s1 = s2 = rffi.cast(lltype.Signed, p1)
if (s1 & (alignment - 1)) != 0: # bah, try again
- lltype.free(p1, flavor='raw')
- p1 = lltype.malloc(rffi.CCHARP.TO, size + (alignment - 1),
- flavor='raw')
+ lltype.free(p1, flavor='raw', track_allocation=False)
+ p1 = lltype.malloc(rffi.CCHARP.TO, size + (alignment - WORD),
+ flavor='raw', track_allocation=False)
s1 = s2 = rffi.cast(lltype.Signed, p1)
- s2 = (s2 + alignment - 1) & ~(alignment - 1)
+ assert s2 & (WORD - 1) == 0 # must return a word-aligned result
+ s2 = (s2 + alignment - WORD) & ~(alignment - WORD)
assert self.allblocks is not None
assert (s1 & 1) == 0 # must be even
- self.allblocks.append(s1)
- return s2
+ self.allblocks.append(s1) # s1 is the address to call free() on
+ return s2 # s2 is the suitably-aligned result
def set_debug(self, v):
r = self._debug
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit