[pypy-commit] pypy stmgc-c8: import stmgc-c8 e55658d12179

Raemi noreply at buildbot.pypy.org
Thu Apr 9 17:12:29 CEST 2015


Author: Remi Meier <remi.meier at inf.ethz.ch>
Branch: stmgc-c8
Changeset: r76768:9789a066a768
Date: 2015-04-09 17:11 +0200
http://bitbucket.org/pypy/pypy/changeset/9789a066a768/

Log:	import stmgc-c8 e55658d12179

diff --git a/rpython/translator/stm/src_stm/revision b/rpython/translator/stm/src_stm/revision
--- a/rpython/translator/stm/src_stm/revision
+++ b/rpython/translator/stm/src_stm/revision
@@ -1,1 +1,1 @@
-1062987da64f
+e55658d12179
diff --git a/rpython/translator/stm/src_stm/stm/gcpage.c b/rpython/translator/stm/src_stm/stm/gcpage.c
--- a/rpython/translator/stm/src_stm/stm/gcpage.c
+++ b/rpython/translator/stm/src_stm/stm/gcpage.c
@@ -106,6 +106,9 @@
 object_t *_stm_allocate_old(ssize_t size_rounded_up)
 {
     /* only for tests xxx but stm_setup_prebuilt() uses this now too */
+    if (size_rounded_up <= GC_LAST_SMALL_SIZE)
+        return _stm_allocate_old_small(size_rounded_up);
+
     stm_char *p = allocate_outside_nursery_large(size_rounded_up);
     object_t *o = (object_t *)p;
 
diff --git a/rpython/translator/stm/src_stm/stm/hashtable.c b/rpython/translator/stm/src_stm/stm/hashtable.c
--- a/rpython/translator/stm/src_stm/stm/hashtable.c
+++ b/rpython/translator/stm/src_stm/stm/hashtable.c
@@ -109,6 +109,8 @@
 {
     /* can only be safely called during major GC, when all other threads
        are suspended */
+    assert(_has_mutex());
+
     long i;
     for (i = 1; i < NB_SEGMENTS; i++) {
         if (get_priv_segment(i)->transaction_state == TS_NONE)
@@ -174,6 +176,7 @@
         if (entry == NULL)
             continue;
         if (segment_base != NULL) {
+            /* -> compaction during major GC */
             if (((struct stm_hashtable_entry_s *)
                        REAL_ADDRESS(segment_base, entry))->object == NULL &&
                    !_stm_was_read_by_anybody((object_t *)entry)) {
@@ -283,6 +286,9 @@
         /* we can only enter here once!  If we allocate stuff, we may
            run the GC, and so 'hashtableobj' might move afterwards. */
         if (_is_in_nursery(hashtableobj)) {
+            /* this also means that the hashtable is from this
+               transaction and not visible to other segments yet, so
+               the new entry can be nursery-allocated. */
             entry = (stm_hashtable_entry_t *)
                 stm_allocate(sizeof(stm_hashtable_entry_t));
             entry->userdata = stm_hashtable_entry_userdata;


More information about the pypy-commit mailing list