Author: Remi Meier
Branch:
Changeset: r965:70871e1c5615
Date: 2014-03-06 10:25 +0100
http://bitbucket.org/pypy/stmgc/changeset/70871e1c5615/
Log: fix gil-c7 with prebuilt objs
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
@@ -339,7 +339,11 @@
td.num_roots_at_transaction_start = td.num_roots;
- STM_START_TRANSACTION(&stm_thread_local, here);
+ if (get_rand(100) < 98) {
+ STM_START_TRANSACTION(&stm_thread_local, here);
+ } else {
+ stm_start_inevitable_transaction(&stm_thread_local);
+ }
td.num_roots = td.num_roots_at_transaction_start;
p = NULL;
pop_roots();
diff --git a/gil-c7/stmgc.c b/gil-c7/stmgc.c
--- a/gil-c7/stmgc.c
+++ b/gil-c7/stmgc.c
@@ -138,7 +138,7 @@
char *p = malloc(size);
assert(p);
memset(p, 0, size);
- ((object_t *)p)->gil_flags = STM_FLAGS_PREBUILT;
+ ((object_t *)p)->gil_flags = _STM_GCFLAG_WRITE_BARRIER;
return (object_t *)p;
}
diff --git a/gil-c7/stmgc.h b/gil-c7/stmgc.h
--- a/gil-c7/stmgc.h
+++ b/gil-c7/stmgc.h
@@ -102,3 +102,9 @@
extern ssize_t stmcb_size_rounded_up(struct object_s *);
extern void stmcb_trace(struct object_s *, void (object_t **));
+
+inline static object_t *stm_setup_prebuilt(object_t *preb)
+{
+ preb->gil_flags |= _STM_GCFLAG_WRITE_BARRIER;
+ return preb;
+}
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit