[pypy-svn] pypy 32ptr-on-64bit: Must round the size up, otherwise we are getting unaligned nursery pointers.

arigo commits-noreply at bitbucket.org
Mon Apr 18 13:55:35 CEST 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: 32ptr-on-64bit
Changeset: r43442:6e2a62ce61aa
Date: 2011-04-17 23:16 +0200
http://bitbucket.org/pypy/pypy/changeset/6e2a62ce61aa/

Log:	Must round the size up, otherwise we are getting unaligned nursery
	pointers.

diff --git a/pypy/jit/backend/x86/assembler.py b/pypy/jit/backend/x86/assembler.py
--- a/pypy/jit/backend/x86/assembler.py
+++ b/pypy/jit/backend/x86/assembler.py
@@ -2096,6 +2096,7 @@
 
     def malloc_cond(self, nursery_free_adr, nursery_top_adr, size, tid):
         size = max(size, self.cpu.gc_ll_descr.minimal_size_in_nursery)
+        size = (size + WORD-1) & ~(WORD-1)     # round up
         self.mc.MOV(eax, heap(nursery_free_adr))
         self.mc.LEA_rm(edx.value, (eax.value, size))
         self.mc.CMP(edx, heap(nursery_top_adr))


More information about the Pypy-commit mailing list