Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r939:657df7c4acdb
Date: 2014-03-03 12:36 +0100
http://bitbucket.org/pypy/stmgc/changeset/657df7c4acdb/

Log:    More tweaks

diff --git a/c7/demo/demo_random.c b/c7/demo/demo_random.c
--- a/c7/demo/demo_random.c
+++ b/c7/demo/demo_random.c
@@ -22,10 +22,13 @@
 
 struct node_s {
     struct object_s hdr;
+    int sig;
     long my_size;
     nodeptr_t next;
 };
 
+#define SIGNATURE 0x01234567
+
 
 static sem_t done;
 __thread stm_thread_local_t stm_thread_local;
@@ -225,6 +228,7 @@
                            sizeof(struct node_s) + 4096*70};
         size_t size = sizes[get_rand(4)];
         p = stm_allocate(size);
+        ((nodeptr_t)p)->sig = SIGNATURE;
         ((nodeptr_t)p)->my_size = size;
         pop_roots();
         /* reload_roots not necessary, all are old after start_transaction */
@@ -310,6 +314,8 @@
         if (td.steps_left % 8 == 0)
             fprintf(stdout, "#");
 
+        assert(p == NULL || ((nodeptr_t)p)->sig == SIGNATURE);
+
         p = do_step(p);
 
         if (p == (objptr_t)-1) {
@@ -351,6 +357,7 @@
     stm_start_inevitable_transaction(&stm_thread_local);
     for (i = 0; i < SHARED_ROOTS; i++) {
         shared_roots[i] = stm_allocate(sizeof(struct node_s));
+        ((nodeptr_t)shared_roots[i])->sig = SIGNATURE;
         ((nodeptr_t)shared_roots[i])->my_size = sizeof(struct node_s);
         STM_PUSH_ROOT(stm_thread_local, shared_roots[i]);
     }
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to