Author: Armin Rigo <[email protected]>
Branch:
Changeset: r70:5c86454b6e59
Date: 2013-06-05 17:44 +0200
http://bitbucket.org/pypy/stmgc/changeset/5c86454b6e59/
Log: Fixes
diff --git a/c3/et.c b/c3/et.c
--- a/c3/et.c
+++ b/c3/et.c
@@ -716,15 +716,6 @@
#endif
L->h_revision = new_revision;
- if (is_young(L))
- {
- item->val = (gcptr)(((revision_t)L) | 2);
-#ifdef DUMP_EXTRA
- fprintf(stderr, "PUBLIC-TO-PROTECTED:\n");
- /*mark*/
-#endif
- }
-
} G2L_LOOP_END;
smp_wmb(); /* a memory barrier: make sure the new L->h_revisions are visible
@@ -742,11 +733,12 @@
assert(R->h_revision != localrev);
#ifdef DUMP_EXTRA
- fprintf(stderr, "%p->h_revision = %p (UpdateChainHeads2)\n",
+ fprintf(stderr, "%p->h_revision = %p | 2 (UpdateChainHeads2)\n",
R, (gcptr)v);
/*mark*/
#endif
- ACCESS_ONCE(R->h_revision) = v;
+ assert(!(v & 3));
+ ACCESS_ONCE(R->h_revision) = v | 2;
if (R->h_tid & GCFLAG_PREBUILT_ORIGINAL)
{
diff --git a/c3/test/test_et.py b/c3/test/test_et.py
--- a/c3/test/test_et.py
+++ b/c3/test/test_et.py
@@ -133,9 +133,11 @@
assert p2 != p
assert classify(p) == "public"
assert classify(p2) == "private"
- lib.rawsetlong(p, 0, 1289222)
+ lib.rawsetlong(p2, 0, 1289222)
lib.stm_commit_transaction()
lib.stm_begin_inevitable_transaction()
assert classify(p) == "public"
assert classify(p2) == "protected"
assert p.h_revision == int(ffi.cast("revision_t", p2)) + 2
+ assert lib.rawgetlong(p, 0) == 28971289
+ assert lib.rawgetlong(p2, 0) == 1289222
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit