Author: Armin Rigo <[email protected]>
Branch:
Changeset: r231:0484208e300e
Date: 2013-06-21 17:32 +0200
http://bitbucket.org/pypy/stmgc/changeset/0484208e300e/
Log: More asserts. The next issue is that we need to reset
GCFLAG_VISITED on stubs (and free unused stubs, too).
diff --git a/c4/gcpage.c b/c4/gcpage.c
--- a/c4/gcpage.c
+++ b/c4/gcpage.c
@@ -198,6 +198,8 @@
if (obj->h_tid & GCFLAG_VISITED) {
fprintf(stderr, "[already visited: %p]\n", obj);
assert(obj == *pobj);
+ assert((obj->h_revision & 3) || /* either odd, or stub */
+ (obj->h_tid & GCFLAG_PRIVATE_FROM_PROTECTED));
return; /* already seen */
}
@@ -248,6 +250,7 @@
if (!(B->h_tid & GCFLAG_PUBLIC)) {
/* a regular private_from_protected object with a backup copy B */
assert(B->h_tid & GCFLAG_BACKUP_COPY);
+ assert(B->h_revision & 1);
B->h_tid |= GCFLAG_VISITED;
}
else {
@@ -285,8 +288,8 @@
for (; pobj != pend; pobj++) {
obj = *pobj;
assert(obj->h_tid & GCFLAG_PREBUILT_ORIGINAL);
- assert(obj->h_tid & GCFLAG_VISITED);
- assert((obj->h_revision & 1) == 0); /* "is a pointer" */
+ obj->h_tid &= ~GCFLAG_VISITED;
+ assert(IS_POINTER(obj->h_revision));
visit((gcptr *)&obj->h_revision);
}
}
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit