[pypy-commit] stmgc default: Revert the change done in a recent commit and fix it differently
arigo
noreply at buildbot.pypy.org
Sun Jun 16 18:21:42 CEST 2013
Author: Armin Rigo <arigo at tunes.org>
Branch:
Changeset: r155:5a94c3c1a159
Date: 2013-06-16 18:21 +0200
http://bitbucket.org/pypy/stmgc/changeset/5a94c3c1a159/
Log: Revert the change done in a recent commit and fix it differently
(there are cases where it was still wrong).
diff --git a/c4/et.c b/c4/et.c
--- a/c4/et.c
+++ b/c4/et.c
@@ -955,7 +955,9 @@
L->h_revision = new_revision;
gcptr stub = stm_stub_malloc(d->public_descriptor);
- stub->h_tid = GCFLAG_PUBLIC | GCFLAG_STUB | GCFLAG_OLD;
+ stub->h_tid = (L->h_tid & STM_USER_TID_MASK) | GCFLAG_PUBLIC
+ | GCFLAG_STUB
+ | GCFLAG_OLD;
stub->h_revision = ((revision_t)L) | 2;
item->val = stub;
diff --git a/c4/nursery.c b/c4/nursery.c
--- a/c4/nursery.c
+++ b/c4/nursery.c
@@ -113,24 +113,9 @@
/* it's a nursery object. Was it already moved? */
if (UNLIKELY(obj->h_tid & GCFLAG_NURSERY_MOVED)) {
-
- /* yes, but was it actually a public object in the nursery?
- (such objects are always NURSERY_MOVED) */
- if (obj->h_tid & GCFLAG_PUBLIC) {
-
- /* follow the chain of revisions. Necessary, otherwise
- we could end up with 'obj' being an incomplete stub. */
- while (1) {
- revision_t v = ACCESS_ONCE(obj->h_revision);
- if (!IS_POINTER(v))
- break;
- obj = (gcptr)v;
- }
- *root = obj;
- return;
- }
-
- /* common case: multiple refs, just fix the ref. */
+ /* yes. Such an object can be a public object in the nursery
+ too (such objects are always NURSERY_MOVED). For all cases,
+ we can just fix the ref. */
*root = (gcptr)obj->h_revision;
return;
}
diff --git a/c4/test/test_random.py b/c4/test/test_random.py
--- a/c4/test/test_random.py
+++ b/c4/test/test_random.py
@@ -506,5 +506,5 @@
def test_more_multi_thread():
#py.test.skip("more random tests")
- for i in range(46, 100):
+ for i in range(100):
yield test_multi_thread, 1200 + i
More information about the pypy-commit
mailing list