1. Pypy
  2. Untitled project
  3. pypy

Commits

Armin Rigo  committed 304495d

tweaks

  • Participants
  • Parent commits 0ba9edd
  • Branches stmgc-c7

Comments (0)

Files changed (3)

File rpython/translator/c/genc.py

View file
  • Ignore whitespace
     # generate the start-up code and put it into a function
     print >> f, 'char *RPython_StartupCode(void) {'
     print >> f, '\tchar *error = NULL;'
-    for line in database.gcpolicy.gc_startup_code():
-        print >> f,"\t" + line
 
     if database.with_stm:
         print >> f, '\tpypy_stm_setup();'
 
+    for line in database.gcpolicy.gc_startup_code():
+        print >> f,"\t" + line
+
     # put float infinities in global constants, we should not have so many of them for now to make
     # a table+loop preferable
     for dest, value in database.late_initializations:

File rpython/translator/c/src/dtoa.c

View file
  • Ignore whitespace
     result = __Py_dg_dtoa(dd, mode, ndigits, decpt, sign, rve);
     _PyPy_SET_53BIT_PRECISION_END;
 #ifdef RPY_STM
-    stm_call_on_abort(result, (void(*)(void *))_PyPy_dg_freedtoa);
+    stm_call_on_abort(&stm_thread_local, result,
+                      (void(*)(void *))_PyPy_dg_freedtoa);
 #endif
     return result;
 }
 void _PyPy_dg_freedtoa(char *s)
 {
 #ifdef RPY_STM
-    stm_call_on_abort(s, NULL);
+    stm_call_on_abort(&stm_thread_local, s, NULL);
 #endif
     __Py_dg_freedtoa(s);
 }

File rpython/translator/c/src/mem.h

View file
  • Ignore whitespace
 
 #ifdef RPY_STM
 void _pypy_stm_free(void *);
-#define _OP_RAW_MALLOCED(r)         stm_call_on_abort(r, _pypy_stm_free)
-#define _OP_RAW_STM_UNREGISTER(r)   stm_call_on_abort(r, NULL)
+#define _OP_RAW_MALLOCED(r)       stm_call_on_abort(&stm_thread_local, r,   \
+                                                                _pypy_stm_free)
+#define _OP_RAW_STM_UNREGISTER(r) stm_call_on_abort(&stm_thread_local, r, NULL)
 #else
 #define _OP_RAW_MALLOCED(r)         /* nothing */
 #define _OP_RAW_STM_UNREGISTER(r)   /* nothing */