[pypy-commit] stmgc default: Test and fix
arigo
noreply at buildbot.pypy.org
Tue Aug 12 18:49:22 CEST 2014
Author: Armin Rigo <arigo at tunes.org>
Branch:
Changeset: r1309:1cb240cc60a2
Date: 2014-08-12 18:49 +0200
http://bitbucket.org/pypy/stmgc/changeset/1cb240cc60a2/
Log: Test and fix
diff --git a/c7/demo/test_shadowstack.c b/c7/demo/test_shadowstack.c
--- a/c7/demo/test_shadowstack.c
+++ b/c7/demo/test_shadowstack.c
@@ -43,12 +43,14 @@
node_t *node = (node_t *)stm_allocate(sizeof(struct node_s));
node->value = 129821;
STM_PUSH_ROOT(stm_thread_local, node);
+ STM_PUSH_ROOT(stm_thread_local, 333); /* odd value */
stm_commit_transaction();
/* now in a new transaction, pop the node off the shadowstack, but
then do a major collection. It should still be found by the
tracing logic. */
stm_start_transaction(&stm_thread_local);
+ STM_POP_ROOT_RET(stm_thread_local);
STM_POP_ROOT(stm_thread_local, node);
assert(node->value == 129821);
STM_PUSH_ROOT(stm_thread_local, NULL);
diff --git a/c7/stm/gcpage.c b/c7/stm/gcpage.c
--- a/c7/stm/gcpage.c
+++ b/c7/stm/gcpage.c
@@ -369,7 +369,8 @@
p = (const struct stm_shadowentry_s *)slice;
end = (const struct stm_shadowentry_s *)(slice + size);
for (; p < end; p++)
- mark_visit_object(p->ss, stm_object_pages);
+ if ((((uintptr_t)p->ss) & 3) == 0)
+ mark_visit_object(p->ss, stm_object_pages);
return NULL;
}
More information about the pypy-commit
mailing list