[pypy-svn] r60876 - pypy/trunk/pypy/config

fijal at codespeak.net fijal at codespeak.net
Sat Jan 10 19:00:09 CET 2009


Author: fijal
Date: Sat Jan 10 19:00:06 2009
New Revision: 60876

Modified:
   pypy/trunk/pypy/config/pypyoption.py
   pypy/trunk/pypy/config/translationoption.py
Log:
A couple of hints for sandboxed interpreter (no all modules and choose
generation gc instead of hybrid)


Modified: pypy/trunk/pypy/config/pypyoption.py
==============================================================================
--- pypy/trunk/pypy/config/pypyoption.py	(original)
+++ pypy/trunk/pypy/config/pypyoption.py	Sat Jan 10 19:00:06 2009
@@ -385,6 +385,8 @@
         modules = working_oo_modules
     else:
         modules = working_modules
+    if config.translation.sandbox:
+        modules = default_modules
     # ignore names from 'essential_modules', notably 'exceptions', which
     # may not be present in config.objspace.usemodules at all
     modules = [name for name in modules if name not in essential_modules]

Modified: pypy/trunk/pypy/config/translationoption.py
==============================================================================
--- pypy/trunk/pypy/config/translationoption.py	(original)
+++ pypy/trunk/pypy/config/translationoption.py	Sat Jan 10 19:00:06 2009
@@ -103,7 +103,8 @@
                default=False, cmdline="--thread"),
     BoolOption("sandbox", "Produce a fully-sandboxed executable",
                default=False, cmdline="--sandbox",
-               requires=[("translation.thread", False)]),
+               requires=[("translation.thread", False)],
+               suggests=[("translation.gc", "generation")]),
     BoolOption("rweakref", "The backend supports RPython-level weakrefs",
                default=True),
 
@@ -340,6 +341,8 @@
     gc = words.pop(0)
 
     # set the GC (only meaningful with lltype)
+    if config.translation.sandbox and gc == 'hybrid':
+        gc = 'generation'
     config.translation.suggest(gc=gc)
 
     # set the backendopts



More information about the Pypy-commit mailing list