Author: Armin Rigo <ar...@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 _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit