[pypy-commit] stmgc c7-refactor: Fixes
arigo
noreply at buildbot.pypy.org
Fri Feb 14 16:25:37 CET 2014
Author: Armin Rigo <arigo at tunes.org>
Branch: c7-refactor
Changeset: r732:9c55d1e9505f
Date: 2014-02-14 16:25 +0100
http://bitbucket.org/pypy/stmgc/changeset/9c55d1e9505f/
Log: Fixes
diff --git a/c7/stm/core.c b/c7/stm/core.c
--- a/c7/stm/core.c
+++ b/c7/stm/core.c
@@ -34,7 +34,7 @@
STM_SEGMENT->transaction_read_version = 1;
}
-void stm_start_transaction(stm_thread_local_t *tl, stm_jmpbuf_t *jmpbuf)
+void _stm_start_transaction(stm_thread_local_t *tl, stm_jmpbuf_t *jmpbuf)
{
/* GS invalid before this point! */
acquire_thread_segment(tl);
diff --git a/c7/stm/gcpage.c b/c7/stm/gcpage.c
--- a/c7/stm/gcpage.c
+++ b/c7/stm/gcpage.c
@@ -15,6 +15,5 @@
object_t* o = (object_t *)(addr - stm_object_pages);
memset(REAL_ADDRESS(STM_SEGMENT->segment_base, o), 0, size_rounded_up);
- o->stm_flags = GCFLAG_WRITE_BARRIER;
return o;
}
diff --git a/c7/stm/misc.c b/c7/stm/misc.c
--- a/c7/stm/misc.c
+++ b/c7/stm/misc.c
@@ -43,5 +43,6 @@
bool _stm_was_written(object_t *obj)
{
- return !(obj->stm_flags & GCFLAG_WRITE_BARRIER);
+ return !!((((stm_creation_marker_t *)(((uintptr_t)obj) >> 8))->cm |
+ obj->stm_flags) & _STM_GCFLAG_WRITE_BARRIER_CALLED);
}
diff --git a/c7/stm/sync.c b/c7/stm/sync.c
--- a/c7/stm/sync.c
+++ b/c7/stm/sync.c
@@ -97,12 +97,12 @@
assert(STM_SEGMENT->running_thread == tl);
}
-void stm_start_safe_point(int flags)
+void _stm_start_safe_point(int flags)
{
//...
}
-void stm_stop_safe_point(int flags)
+void _stm_stop_safe_point(int flags)
{
//...
}
diff --git a/c7/test/support.py b/c7/test/support.py
--- a/c7/test/support.py
+++ b/c7/test/support.py
@@ -47,7 +47,7 @@
void stm_teardown(void);
void stm_register_thread_local(stm_thread_local_t *tl);
void stm_unregister_thread_local(stm_thread_local_t *tl);
-void stm_copy_prebuilt_objects(object_t *target, char *source, ssize_t size);
+//void stm_copy_prebuilt_objects(object_t *target, char *source, ssize_t size);
bool _checked_stm_write(object_t *obj);
bool _stm_was_read(object_t *obj);
@@ -58,7 +58,7 @@
bool _stm_in_transaction(stm_thread_local_t *tl);
void _stm_test_switch(stm_thread_local_t *tl);
-void stm_start_transaction(stm_thread_local_t *tl, stm_jmpbuf_t *jmpbuf);
+void _stm_start_transaction(stm_thread_local_t *tl, stm_jmpbuf_t *jmpbuf);
void stm_commit_transaction(void);
bool _check_abort_transaction(void);
@@ -69,7 +69,7 @@
#define LOCK_EXCLUSIVE ...
#define THREAD_YIELD ...
-void stm_start_safe_point(int);
+void _stm_start_safe_point(int);
bool _check_stop_safe_point(int);
""")
@@ -200,7 +200,7 @@
if (__builtin_setjmp(here) == 0) { // returned directly
assert(segment->jmpbuf_ptr == (stm_jmpbuf_t *)-1);
segment->jmpbuf_ptr = &here;
- stm_stop_safe_point(flags);
+ _stm_stop_safe_point(flags);
segment->jmpbuf_ptr = (stm_jmpbuf_t *)-1;
return 0;
}
@@ -368,7 +368,7 @@
def stm_start_safe_point():
- lib.stm_start_safe_point(lib.LOCK_COLLECT)
+ lib._stm_start_safe_point(lib.LOCK_COLLECT)
def stm_stop_safe_point():
if lib._check_stop_safe_point(lib.LOCK_COLLECT):
@@ -421,7 +421,7 @@
def start_transaction(self):
tl = self.tls[self.current_thread]
assert not lib._stm_in_transaction(tl)
- lib.stm_start_transaction(tl, ffi.cast("stm_jmpbuf_t *", -1))
+ lib._stm_start_transaction(tl, ffi.cast("stm_jmpbuf_t *", -1))
assert lib._stm_in_transaction(tl)
def commit_transaction(self):
More information about the pypy-commit
mailing list