[pypy-commit] pypy stm-gc: Fix.

arigo noreply at buildbot.pypy.org
Mon Apr 16 15:51:27 CEST 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: stm-gc
Changeset: r54415:3252ee877473
Date: 2012-04-15 16:08 +0200
http://bitbucket.org/pypy/pypy/changeset/3252ee877473/

Log:	Fix.

diff --git a/pypy/rpython/memory/gc/test/test_stmtls.py b/pypy/rpython/memory/gc/test/test_stmtls.py
--- a/pypy/rpython/memory/gc/test/test_stmtls.py
+++ b/pypy/rpython/memory/gc/test/test_stmtls.py
@@ -25,22 +25,19 @@
     pass
 
 class FakeRootWalker:
-    def walk_roots(self, f1, f2, f3, arg):
-        if f1 is not None:
-            A = lltype.Array(llmemory.Address)
-            roots = lltype.malloc(A, len(self.current_stack), flavor='raw')
-            for i in range(len(self.current_stack)):
-                roots[i] = llmemory.cast_ptr_to_adr(self.current_stack[i])
-            for i in range(len(self.current_stack)):
-                root = lltype.direct_ptradd(lltype.direct_arrayitems(roots), i)
-                root = llmemory.cast_ptr_to_adr(root)
-                f1(arg, root)
-            for i in range(len(self.current_stack)):
-                P = lltype.typeOf(self.current_stack[i])
-                self.current_stack[i] = llmemory.cast_adr_to_ptr(roots[i], P)
-            lltype.free(roots, flavor='raw')
-        assert f2 is None
-        assert f3 is None
+    def walk_current_stack_roots(self, callback, arg):
+        A = lltype.Array(llmemory.Address)
+        roots = lltype.malloc(A, len(self.current_stack), flavor='raw')
+        for i in range(len(self.current_stack)):
+            roots[i] = llmemory.cast_ptr_to_adr(self.current_stack[i])
+        for i in range(len(self.current_stack)):
+            root = lltype.direct_ptradd(lltype.direct_arrayitems(roots), i)
+            root = llmemory.cast_ptr_to_adr(root)
+            callback(arg, root)
+        for i in range(len(self.current_stack)):
+            P = lltype.typeOf(self.current_stack[i])
+            self.current_stack[i] = llmemory.cast_adr_to_ptr(roots[i], P)
+        lltype.free(roots, flavor='raw')
 
 class FakeGC:
     from pypy.rpython.memory.support import AddressDict, null_address_dict


More information about the pypy-commit mailing list