1. Pypy
  2. Untitled project
  3. pypy

Commits

Remi Meier  committed c62679c

HTM adaptions

  • Participants
  • Parent commits 1f5cf37
  • Branches stmgc-c7

Comments (0)

Files changed (1)

File rpython/translator/stm/src_stm/stmgcintf.c

View file
 /* This is not meant to be compiled stand-alone, but with all
    of PyPy's #defines and #includes prepended. */
 
-__thread struct stm_thread_local_s stm_thread_local;
+__thread struct stm_thread_local_s stm_thread_local __attribute__((aligned(64)));
 
 /* 0 = not initialized; 1 = normal mode; 2 or more = atomic mode */
 __thread long pypy_stm_ready_atomic;
        to a value slightly smaller than the value at last abort.
     */
     long counter, limit;
+#ifdef HTM_INFO_AVAILABLE
+    if (_htm_info.use_gil)
+        counter = 0;            /* maybe we want the default size here... */
+    else
+        counter = _htm_info.retry_counter;
+    limit = pypy_transaction_length >> counter;
+#else
     counter = *v_counter;
     *v_counter = counter + 1;
 
         limit = stm_thread_local.last_abort__bytes_in_nursery;
         limit -= (limit >> 4);
     }
+#endif
+
     pypy_stm_nursery_low_fill_mark = _stm_nursery_start + limit;
     pypy_stm_ready_atomic = 1; /* reset after abort */
 }