[pypy-commit] pypy gc-del: Kill the config options for the removed GC, and fix test_sandbox.

arigo noreply at buildbot.pypy.org
Sat Apr 27 15:46:55 CEST 2013


Author: Armin Rigo <arigo at tunes.org>
Branch: gc-del
Changeset: r63695:dc83e26b5a7e
Date: 2013-04-27 15:45 +0200
http://bitbucket.org/pypy/pypy/changeset/dc83e26b5a7e/

Log:	Kill the config options for the removed GC, and fix test_sandbox.

diff --git a/rpython/config/translationoption.py b/rpython/config/translationoption.py
--- a/rpython/config/translationoption.py
+++ b/rpython/config/translationoption.py
@@ -57,17 +57,12 @@
 
     # gc
     ChoiceOption("gc", "Garbage Collection Strategy",
-                 ["boehm", "ref", "semispace", "statistics",
-                  "generation", "hybrid", "minimark", "none"],
+                 ["boehm", "ref", "minimark", "none"],
                   "ref", requires={
                      "ref": [("translation.rweakref", False), # XXX
                              ("translation.gctransformer", "ref")],
                      "none": [("translation.rweakref", False), # XXX
                              ("translation.gctransformer", "none")],
-                     "semispace": [("translation.gctransformer", "framework")],
-                     "statistics": [("translation.gctransformer", "framework")],
-                     "generation": [("translation.gctransformer", "framework")],
-                     "hybrid": [("translation.gctransformer", "framework")],
                      "boehm": [("translation.continuation", False),  # breaks
                                ("translation.gctransformer", "boehm")],
                      "minimark": [("translation.gctransformer", "framework")],
@@ -103,8 +98,7 @@
     BoolOption("sandbox", "Produce a fully-sandboxed executable",
                default=False, cmdline="--sandbox",
                requires=[("translation.thread", False)],
-               suggests=[("translation.gc", "generation"),
-                         ("translation.gcrootfinder", "shadowstack")]),
+               suggests=[("translation.gcrootfinder", "shadowstack")]),
     BoolOption("rweakref", "The backend supports RPython-level weakrefs",
                default=True),
 
diff --git a/rpython/translator/sandbox/test/test_sandbox.py b/rpython/translator/sandbox/test/test_sandbox.py
--- a/rpython/translator/sandbox/test/test_sandbox.py
+++ b/rpython/translator/sandbox/test/test_sandbox.py
@@ -9,16 +9,17 @@
 from rpython.translator.sandbox.sandlib import write_exception
 
 def expect(f, g, fnname, args, result, resulttype=None):
-    msg = read_message(f, timeout=10.0)
-    assert msg == fnname
-    msg = read_message(f, timeout=10.0)
-    assert msg == args
+    msg1 = read_message(f, timeout=10.0)
+    msg2 = read_message(f, timeout=10.0)
+    assert (msg1, msg2) == (fnname, args), (
+        "expected: %r %r\n" % (fnname, args) +
+        " but got: %r %r" % (msg1, msg2))
     if isinstance(result, Exception):
         write_exception(g, result)
     else:
         write_message(g, 0)
         write_message(g, result, resulttype)
-        g.flush()
+    g.flush()
 
 def compile(f, gc='ref'):
     t = Translation(f, backend='c', sandbox=True, gc=gc,
@@ -148,22 +149,31 @@
     f.close()
     assert tail == ""
 
-def test_hybrid_gc():
+def test_minimark_gc():
     def entry_point(argv):
         l = []
         for i in range(int(argv[1])):
             l.append("x" * int(argv[2]))
         return int(len(l) > 1000)
 
-    exe = compile(entry_point, gc='hybrid')
+    exe = compile(entry_point, gc='minimark')
     pipe = subprocess.Popen([exe, '10', '10000'], stdout=subprocess.PIPE,
                             stdin=subprocess.PIPE)
     g = pipe.stdin
     f = pipe.stdout
-    expect(f, g, "ll_os.ll_os_getenv", ("PYPY_GENERATIONGC_NURSERY",), None)
-    #if sys.platform.startswith('linux'):
-    #    expect(f, g, "ll_os.ll_os_open", ("/proc/cpuinfo", 0, 420),
-    #           OSError(5232, "xyz"))
+    expect(f, g, "ll_os.ll_os_getenv", ("PYPY_GC_NURSERY",), None)
+    if sys.platform.startswith('linux'):
+        expect(f, g, "ll_os.ll_os_open", ("/proc/cpuinfo", 0, 420),
+               OSError(5232, "xyz"))
+    expect(f, g, "ll_os.ll_os_getenv", ("PYPY_GC_NURSERY_CLEANUP",), None)
+    expect(f, g, "ll_os.ll_os_getenv", ("PYPY_GC_MAJOR_COLLECT",), None)
+    expect(f, g, "ll_os.ll_os_getenv", ("PYPY_GC_GROWTH",), None)
+    expect(f, g, "ll_os.ll_os_getenv", ("PYPY_GC_MIN",), None)
+    expect(f, g, "ll_os.ll_os_getenv", ("PYPY_GC_MAX",), None)
+    expect(f, g, "ll_os.ll_os_getenv", ("PYPY_GC_MAX_DELTA",), None)
+    if sys.platform.startswith('linux'):
+        expect(f, g, "ll_os.ll_os_open", ("/proc/meminfo", 0, 420),
+               OSError(5232, "xyz"))
     expect(f, g, "ll_os.ll_os_getenv", ("PYPY_GC_DEBUG",), None)
     g.close()
     tail = f.read()


More information about the pypy-commit mailing list