Author: Armin Rigo <[email protected]>
Branch: boehm-rawrefcount
Changeset: r86929:226d5e4b2e41
Date: 2016-09-07 14:50 +0200
http://bitbucket.org/pypy/pypy/changeset/226d5e4b2e41/
Log: test and fix
diff --git a/rpython/rlib/src/boehm-rawrefcount.c
b/rpython/rlib/src/boehm-rawrefcount.c
--- a/rpython/rlib/src/boehm-rawrefcount.c
+++ b/rpython/rlib/src/boehm-rawrefcount.c
@@ -190,6 +190,7 @@
printf("next_dead: %p\n", result);
#endif
assert(result->ob_refcnt == REFCNT_FROM_PYPY);
+ result->ob_refcnt = 1;
p->pyobj = NULL;
*pp = p->next_in_bucket;
p->next_in_bucket = hash_free_list;
diff --git a/rpython/rlib/test/test_rawrefcount.py
b/rpython/rlib/test/test_rawrefcount.py
--- a/rpython/rlib/test/test_rawrefcount.py
+++ b/rpython/rlib/test/test_rawrefcount.py
@@ -254,6 +254,9 @@
if rawrefcount.next_dead(PyObject) != ob:
print "NEXT_DEAD != OB"
return 1
+ if ob.c_ob_refcnt != 1:
+ print "next_dead().ob_refcnt != 1"
+ return 1
if rawrefcount.next_dead(PyObject) != lltype.nullptr(PyObjectS):
print "NEXT_DEAD second time != NULL"
return 1
@@ -294,6 +297,9 @@
while True:
ob = rawrefcount.next_dead(PyObject)
if not ob: break
+ if ob.c_ob_refcnt != 1:
+ print "next_dead().ob_refcnt != 1"
+ return 1
deadlist.append(ob)
if len(deadlist) == 0:
print "no dead object"
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit