[pypy-commit] stmgc weakref: and there was a bug in demo_random
Raemi
noreply at buildbot.pypy.org
Thu Jul 18 16:12:12 CEST 2013
Author: Remi Meier <remi.meier at gmail.com>
Branch: weakref
Changeset: r412:324c3f18bbad
Date: 2013-07-18 16:11 +0200
http://bitbucket.org/pypy/stmgc/changeset/324c3f18bbad/
Log: and there was a bug in demo_random
diff --git a/c4/demo_random.c b/c4/demo_random.c
--- a/c4/demo_random.c
+++ b/c4/demo_random.c
@@ -506,7 +506,7 @@
gcptr weakref_events(gcptr p, gcptr _r, gcptr _sr)
{
nodeptr t;
- weaknodeptr w;
+ weaknodeptr w, ww;
gcptr ptrs[] = {_r, _sr};
int i = get_rand(2);
@@ -516,10 +516,11 @@
t = (nodeptr)read_barrier(ptrs[i]);
w = t->weakref;
if(w) {
- assert(stm_get_tid((gcptr)w) == GCTID_WEAKREF);
- if (w->node) {
- check((gcptr)w->node);
- return (gcptr)w->node;
+ ww = stm_read_barrier(w);
+ assert(stm_get_tid((gcptr)ww) == GCTID_WEAKREF);
+ if (ww->node) {
+ check((gcptr)ww->node);
+ return (gcptr)ww->node;
}
else {
t->weakref = NULL;
diff --git a/c4/weakref.c b/c4/weakref.c
--- a/c4/weakref.c
+++ b/c4/weakref.c
@@ -18,7 +18,6 @@
/***** Minor collection *****/
-
static int is_in_nursery(struct tx_descriptor *d, gcptr obj)
{
return (d->nursery_base <= (char*)obj && ((char*)obj) < d->nursery_end);
More information about the pypy-commit
mailing list