[pypy-commit] pypy lightweight-finalizers: improve the test and fix it
fijal
noreply at buildbot.pypy.org
Fri Sep 30 17:34:52 CEST 2011
Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: lightweight-finalizers
Changeset: r47719:1d3fe3419101
Date: 2011-09-30 11:41 -0300
http://bitbucket.org/pypy/pypy/changeset/1d3fe3419101/
Log: improve the test and fix it
diff --git a/pypy/rpython/memory/gc/generation.py b/pypy/rpython/memory/gc/generation.py
--- a/pypy/rpython/memory/gc/generation.py
+++ b/pypy/rpython/memory/gc/generation.py
@@ -572,17 +572,14 @@
# table is bad for the next call to 'foreach'.
def deal_with_young_objects_with_raw_mem(self):
- new_objs_with_raw_mem = self.AddressStack()
while self.young_objects_with_raw_mem.non_empty():
addr = self.young_objects_with_raw_mem.pop()
if self.surviving(addr):
- new_objs_with_raw_mem.append(self.get_forwarding_address(addr))
+ self.objects_with_raw_mem.append(
+ self.get_forwarding_address(addr))
else:
self._free_raw_mem_from(addr)
- self.young_objects_with_raw_mem.delete()
- self.young_objects_with_raw_mem = new_objs_with_raw_mem
-
def ids_grow_older(self):
self.young_objects_with_id.foreach(self._id_grow_older, None)
self.young_objects_with_id.clear()
diff --git a/pypy/rpython/memory/test/test_gc.py b/pypy/rpython/memory/test/test_gc.py
--- a/pypy/rpython/memory/test/test_gc.py
+++ b/pypy/rpython/memory/test/test_gc.py
@@ -143,7 +143,7 @@
def f():
a = AClass(0)
- for i in range(3):
+ for i in range(30):
a = AClass(3)
AClass(0)
llop.gc__collect(lltype.Void)
More information about the pypy-commit
mailing list