[pypy-svn] pypy arm-backend-2: Document the calculation of the size for the allocated memory

bivab commits-noreply at bitbucket.org
Fri Jan 14 10:25:02 CET 2011


Author: David Schneider <david.schneider at picle.org>
Branch: arm-backend-2
Changeset: r40663:1e471c8d1dfd
Date: 2011-01-12 15:52 +0100
http://bitbucket.org/pypy/pypy/changeset/1e471c8d1dfd/

Log:	Document the calculation of the size for the allocated memory

diff --git a/pypy/jit/backend/arm/assembler.py b/pypy/jit/backend/arm/assembler.py
--- a/pypy/jit/backend/arm/assembler.py
+++ b/pypy/jit/backend/arm/assembler.py
@@ -218,8 +218,15 @@
             assert isinstance(descr, AbstractFailDescr)
             descr._arm_frame_depth = arglocs[0].getint()
         reg = r.lr
+        # The size of the allocated memory is based on the following sizes
+        # first argloc is the frame depth and not considered for the memory
+        # allocation
+        # 4 bytes for the value
+        # 1 byte for the type
+        # 1 byte for the location
+        # 1 separator byte
+        # 4 bytes for the faildescr
         # XXX free this memory
-        # XXX allocate correct amount of memory
         mem = lltype.malloc(rffi.CArray(lltype.Char), (len(arglocs)-1)*6+5,
                                     flavor='raw', track_allocation=False)
         i = 0


More information about the Pypy-commit mailing list