[pypy-svn] r49713 - pypy/dist/pypy/rpython/memory/gc

arigo at codespeak.net arigo at codespeak.net
Thu Dec 13 14:11:15 CET 2007


Author: arigo
Date: Thu Dec 13 14:11:14 2007
New Revision: 49713

Modified:
   pypy/dist/pypy/rpython/memory/gc/base.py
Log:
Avoid this multiplication in here.


Modified: pypy/dist/pypy/rpython/memory/gc/base.py
==============================================================================
--- pypy/dist/pypy/rpython/memory/gc/base.py	(original)
+++ pypy/dist/pypy/rpython/memory/gc/base.py	Thu Dec 13 14:11:14 2007
@@ -121,19 +121,18 @@
             callback(obj + offsets[i], arg)
             i += 1
         if self.has_gcptr_in_varsize(typeid):
-            offset = self.varsize_offset_to_variable_part(
-                typeid)
+            item = obj + self.varsize_offset_to_variable_part(typeid)
             length = (obj + self.varsize_offset_to_length(typeid)).signed[0]
             offsets = self.varsize_offsets_to_gcpointers_in_var_part(typeid)
             itemlength = self.varsize_item_sizes(typeid)
             i = 0
             while i < length:
-                item = obj + offset + itemlength * i
                 j = 0
                 while j < len(offsets):
                     callback(item + offsets[j], arg)
                     j += 1
                 i += 1
+                item += itemlength
     trace._annspecialcase_ = 'specialize:arg(2)'
 
 



More information about the Pypy-commit mailing list