Author: Armin Rigo <ar...@tunes.org>
Branch: 
Changeset: r48666:548c842da8b9
Date: 2011-11-02 17:49 +0100
http://bitbucket.org/pypy/pypy/changeset/548c842da8b9/

Log:    Found the cause of the failure of test_nongc_attached_to_gc in
        test_newgc: we forgot to add the surviving objects from
        young_objects_with_light_finalizers to the old version of that list.

        Fix the test and re-enable light finalizers with minimark.

diff --git a/pypy/rpython/memory/gc/minimark.py 
b/pypy/rpython/memory/gc/minimark.py
--- a/pypy/rpython/memory/gc/minimark.py
+++ b/pypy/rpython/memory/gc/minimark.py
@@ -468,7 +468,7 @@
         #
         # If the object needs a finalizer, ask for a rawmalloc.
         # The following check should be constant-folded.
-        if needs_finalizer:  ## and not is_finalizer_light:
+        if needs_finalizer and not is_finalizer_light:
             ll_assert(not contains_weakptr,
                      "'needs_finalizer' and 'contains_weakptr' both specified")
             obj = self.external_malloc(typeid, 0, can_make_young=False)
@@ -1850,6 +1850,9 @@
                 finalizer = self.getlightfinalizer(self.get_type_id(obj))
                 ll_assert(bool(finalizer), "no light finalizer found")
                 finalizer(obj, llmemory.NULL)
+            else:
+                obj = self.get_forwarding_address(obj)
+                self.old_objects_with_light_finalizers.append(obj)
 
     def deal_with_old_objects_with_finalizers(self):
         """ This is a much simpler version of dealing with finalizers
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to