[pypy-commit] pypy stmgc-c7: tweaks

arigo noreply at buildbot.pypy.org
Tue Mar 11 10:50:49 CET 2014


Author: Armin Rigo <arigo at tunes.org>
Branch: stmgc-c7
Changeset: r69856:304495dc8009
Date: 2014-03-11 10:41 +0100
http://bitbucket.org/pypy/pypy/changeset/304495dc8009/

Log:	tweaks

diff --git a/rpython/translator/c/genc.py b/rpython/translator/c/genc.py
--- a/rpython/translator/c/genc.py
+++ b/rpython/translator/c/genc.py
@@ -819,12 +819,13 @@
     # 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:
diff --git a/rpython/translator/c/src/dtoa.c b/rpython/translator/c/src/dtoa.c
--- a/rpython/translator/c/src/dtoa.c
+++ b/rpython/translator/c/src/dtoa.c
@@ -2969,7 +2969,8 @@
     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;
 }
@@ -2977,7 +2978,7 @@
 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);
 }
diff --git a/rpython/translator/c/src/mem.h b/rpython/translator/c/src/mem.h
--- a/rpython/translator/c/src/mem.h
+++ b/rpython/translator/c/src/mem.h
@@ -13,8 +13,9 @@
 
 #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 */


More information about the pypy-commit mailing list