[pypy-svn] r68773 - in pypy/branch/gc-dump-heap/pypy/rpython/memory: gc test

fijal at codespeak.net fijal at codespeak.net
Mon Oct 26 21:41:42 CET 2009


Author: fijal
Date: Mon Oct 26 21:41:41 2009
New Revision: 68773

Modified:
   pypy/branch/gc-dump-heap/pypy/rpython/memory/gc/semispace.py
   pypy/branch/gc-dump-heap/pypy/rpython/memory/test/test_transformed_gc.py
Log:
Improve the test and also not count objects used for storage


Modified: pypy/branch/gc-dump-heap/pypy/rpython/memory/gc/semispace.py
==============================================================================
--- pypy/branch/gc-dump-heap/pypy/rpython/memory/gc/semispace.py	(original)
+++ pypy/branch/gc-dump-heap/pypy/rpython/memory/gc/semispace.py	Mon Oct 26 21:41:41 2009
@@ -670,6 +670,11 @@
         for i in range(max_tid):
             ll_typeid_map[i] = lltype.malloc(TYPEID_MAP, max_tid, zero=True)
         self._ll_typeid_map = ll_typeid_map
+        self._tracked_dict.add(llmemory.cast_ptr_to_adr(ll_typeid_map))
+        i = 0
+        while i < max_tid:
+            self._tracked_dict.add(llmemory.cast_ptr_to_adr(ll_typeid_map[i]))
+            i += 1
         self.dump_heap_walk_roots()
         self._ll_typeid_map = lltype.nullptr(ARRAY_TYPEID_MAP)
         self._tracked_dict.delete()

Modified: pypy/branch/gc-dump-heap/pypy/rpython/memory/test/test_transformed_gc.py
==============================================================================
--- pypy/branch/gc-dump-heap/pypy/rpython/memory/test/test_transformed_gc.py	(original)
+++ pypy/branch/gc-dump-heap/pypy/rpython/memory/test/test_transformed_gc.py	Mon Oct 26 21:41:41 2009
@@ -819,15 +819,18 @@
             nr = 0
             b = 0
             c = 0
+            d = 0
             for i in range(len(tb)):
                 if tb[i].count == 10:
                     a += 1
                     nr = i
+                if tb[i].count > 50:
+                    d += 1
             for i in range(len(tb)):
                 if tb[i].count == 4:
                     b += 1
                     c += tb[i].links[nr]
-            return c * 100 + b * 10 + a
+            return d * 1000 + c * 100 + b * 10 + a
         return f
 
     def test_gc_dump_heap(self):



More information about the Pypy-commit mailing list