[pypy-commit] stmgc c7-more-segments: Fix (and simplify the code a bit)
arigo
noreply at buildbot.pypy.org
Sun Mar 16 11:02:45 CET 2014
Author: Armin Rigo <arigo at tunes.org>
Branch: c7-more-segments
Changeset: r1034:88810db654ce
Date: 2014-03-16 11:00 +0100
http://bitbucket.org/pypy/stmgc/changeset/88810db654ce/
Log: Fix (and simplify the code a bit)
diff --git a/c7/stm/weakref.c b/c7/stm/weakref.c
--- a/c7/stm/weakref.c
+++ b/c7/stm/weakref.c
@@ -29,29 +29,21 @@
static void _set_weakref_in_all_segments(object_t *weakref, object_t *value)
{
- abort();//XXX
-#if 0
ssize_t size = 16;
stm_char *point_to_loc = (stm_char*)WEAKREF_PTR(weakref, size);
- if (flag_page_private[(uintptr_t)point_to_loc / 4096UL] == PRIVATE_PAGE) {
- long i;
- for (i = 0; i < NB_SEGMENTS; i++) {
- char *base = get_segment_base(i); /* two different segments */
- object_t ** ref_loc = (object_t **)REAL_ADDRESS(base, point_to_loc);
- *ref_loc = value;
- }
+ long i;
+ for (i = 1; i <= NB_SEGMENTS; i++) {
+ char *base = get_segment_base(i);
+ object_t ** ref_loc = (object_t **)REAL_ADDRESS(base, point_to_loc);
+ *ref_loc = value;
}
- else {
- *WEAKREF_PTR(weakref, size) = value;
- }
-#endif
}
/***** Minor collection *****/
-static void stm_move_young_weakrefs()
+static void stm_move_young_weakrefs(void)
{
/* The code relies on the fact that no weakref can be an old object
weakly pointing to a young object. Indeed, weakrefs are immutable
More information about the pypy-commit
mailing list