[pypy-svn] r39896 - pypy/dist/pypy/translator/c

mwh at codespeak.net mwh at codespeak.net
Sun Mar 4 16:15:01 CET 2007


Author: mwh
Date: Sun Mar  4 16:14:59 2007
New Revision: 39896

Modified:
   pypy/dist/pypy/translator/c/gc.py
Log:
make the decisions about which #defines to give to the boehm gc a bit saner.
in particular, use GC_REDIRECT_TO_LOCAL all the time, which makes pypy-c about
5-10% faster on OS X (well, tuatara, at least...).
someone should do a windows build, i guess...


Modified: pypy/dist/pypy/translator/c/gc.py
==============================================================================
--- pypy/dist/pypy/translator/c/gc.py	(original)
+++ pypy/dist/pypy/translator/c/gc.py	Sun Mar  4 16:14:59 2007
@@ -216,21 +216,12 @@
 
     def pre_pre_gc_code(self):
         if sys.platform == "linux2":
-            if self.thread_enabled or True:
-                yield "#define _REENTRANT 1"
-                yield "#define GC_LINUX_THREADS 1"
-                yield "#define GC_REDIRECT_TO_LOCAL 1"
-                yield "#define GC_I_HIDE_POINTERS 1"
-                yield '#include <gc/gc_local_alloc.h>'
-                yield '#define USING_BOEHM_GC'
-            else:
-                yield "#define GC_I_HIDE_POINTERS 1"
-                yield '#include <gc/gc.h>'
-                yield '#define USING_BOEHM_GC'
-        else:
-            yield "#define GC_I_HIDE_POINTERS 1"
-            yield '#include <gc/gc.h>'
-            yield '#define USING_BOEHM_GC'
+            yield "#define _REENTRANT 1"
+            yield "#define GC_LINUX_THREADS 1"
+        yield "#define GC_I_HIDE_POINTERS 1"
+        yield "#define GC_REDIRECT_TO_LOCAL 1"
+        yield '#include <gc/gc.h>'
+        yield '#define USING_BOEHM_GC'
 
     def pre_gc_code(self):
         return []



More information about the Pypy-commit mailing list