Commits

Armin Rigo committed 42875d8

The first test to pass would be this: record and detect young objects
with (non-light) finalizers

  • Participants
  • Parent commits a33d213
  • Branches gc-del-2

Comments (0)

Files changed (1)

File rpython/memory/test/test_minimark_gc.py

     GC_CAN_MALLOC_NONMOVABLE = True
     BUT_HOW_BIG_IS_A_BIG_STRING = 11*WORD
 
+    def test_finalizer_young_obj(self):
+        class A:
+            def __del__(self):
+                state.seen += 1
+        class State:
+            pass
+        state = State()
+
+        def f():
+            state.seen = 0
+            A(); A()
+            rgc.collect(0)    # minor collection only
+            return state.seen
+
+        assert self.interpret(f, []) == 2
+
     def test_finalizer_chain_minor_collect(self):
         class A:
             def __init__(self, n, next):