[pypy-commit] stmgc default: A "mark" and a test checking for that mark.

arigo noreply at buildbot.pypy.org
Sun May 26 19:10:54 CEST 2013


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r24:2360127bd31b
Date: 2013-05-26 19:10 +0200
http://bitbucket.org/pypy/stmgc/changeset/2360127bd31b/

Log:	A "mark" and a test checking for that mark.

diff --git a/c3/nursery.c b/c3/nursery.c
--- a/c3/nursery.c
+++ b/c3/nursery.c
@@ -681,6 +681,7 @@
         stub = item->val;
         assert(stub->h_revision == (((revision_t)obj) | 2));
         *pobj = stub;
+        /*mark*/
         return;
     }
 
diff --git a/c3/test/test_nursery.py b/c3/test/test_nursery.py
--- a/c3/test/test_nursery.py
+++ b/c3/test/test_nursery.py
@@ -317,7 +317,7 @@
     run_parallel(f1, f2)
 
 def test_stubs_are_public_to_young_collect():
-    pg = palloc_refs(1)
+    pg = palloc_refs(2)
     #
     p1 = lib.stm_write_barrier(pg)
     assert lib.in_nursery(p1)
@@ -328,6 +328,7 @@
     q1 = nalloc(HDR + WORD)
     lib.setlong(q1, 0, 424242)
     lib.setptr(p1, 0, q1)
+    lib.setptr(p1, 1, q1)
     assert not lib.in_nursery(p1)
     assert lib.in_nursery(q1)
     #
@@ -341,6 +342,7 @@
     p1b = lib.stm_pop_root()
     assert p1b == p1
     q1b = lib.getptr(p1, 0)
+    assert q1b == lib.getptr(p1, 1)
     assert not lib.in_nursery(q1b)
     assert lib.getlong(q1b, 0) == 424242
 


More information about the pypy-commit mailing list