[pypy-commit] stmgc copy-over-original2: Fix test

arigo noreply at buildbot.pypy.org
Fri Jul 26 12:37:34 CEST 2013


Author: Armin Rigo <arigo at tunes.org>
Branch: copy-over-original2
Changeset: r450:e6aa22bd6c25
Date: 2013-07-26 12:37 +0200
http://bitbucket.org/pypy/stmgc/changeset/e6aa22bd6c25/

Log:	Fix test

diff --git a/c4/et.h b/c4/et.h
--- a/c4/et.h
+++ b/c4/et.h
@@ -77,8 +77,9 @@
 static const revision_t GCFLAG_PRIVATE_FROM_PROTECTED = STM_FIRST_GCFLAG << 9;
 static const revision_t GCFLAG_HAS_ID                 = STM_FIRST_GCFLAG << 10;
 static const revision_t GCFLAG_IMMUTABLE              = STM_FIRST_GCFLAG << 11;
-static const revision_t GCFLAG_SMALLSTUB              = STM_FIRST_GCFLAG << 12;
+static const revision_t GCFLAG_SMALLSTUB    /*debug*/ = STM_FIRST_GCFLAG << 12;
 static const revision_t GCFLAG_MARKED                 = STM_FIRST_GCFLAG << 13;
+/* warning, the last flag available is "<< 15" on 32-bit */
 
 
 /* this value must be reflected in PREBUILT_FLAGS in stmgc.h */
diff --git a/c4/test/test_weakref.py b/c4/test/test_weakref.py
--- a/c4/test/test_weakref.py
+++ b/c4/test/test_weakref.py
@@ -109,12 +109,14 @@
         lib.stm_commit_transaction()
         lib.stm_begin_inevitable_transaction()
         #
+        assert lib.rawgetptr(p1, 0) == p2
         assert lib.rawgetlong(p2, 0) == 0
         lib.stm_push_root(p1)
         lib.stm_push_root(p2)
         major_collect()
         p2b = lib.stm_pop_root()
         p1 = lib.stm_pop_root()
-        assert lib.rawgetptr(p1, 0) == p2b
+        assert lib.rawgetptr(p1, 0) == p2
         assert p2b != p2
         assert lib.getlong(p2b, 0) == 912809218
+        assert lib.getlong(p2, 0) == 912809218
diff --git a/c4/weakref.c b/c4/weakref.c
--- a/c4/weakref.c
+++ b/c4/weakref.c
@@ -70,11 +70,11 @@
 {
     /* Based on gcpage.c:visit_public().  Check the code here if we change
        visit_public().  Returns True or False depending on whether we find any
-       version of 'obj' to be VISITED or not.
+       version of 'obj' to be MARKED or not.
     */
     assert(IMPLIES(obj->h_tid & GCFLAG_VISITED,
                    obj->h_tid & GCFLAG_MARKED));
-    if (obj->h_tid & GCFLAG_VISITED)
+    if (obj->h_tid & GCFLAG_MARKED)
         return 1;
 
     if (!(obj->h_tid & GCFLAG_PUBLIC))


More information about the pypy-commit mailing list