Author: Stefan Beyer <h...@sbeyer.at>
Branch: cpyext-gc-cycle
Changeset: r95603:b74906a7ac4b
Date: 2018-05-10 11:12 +0200
http://bitbucket.org/pypy/pypy/changeset/b74906a7ac4b/

Log:    Removed unnecessary code

diff --git a/pypy/module/cpyext/api.py b/pypy/module/cpyext/api.py
--- a/pypy/module/cpyext/api.py
+++ b/pypy/module/cpyext/api.py
@@ -43,6 +43,7 @@
 from rpython.rlib import rstackovf
 from pypy.objspace.std.typeobject import W_TypeObject, find_best_base
 from pypy.module.cpyext.cparser import CTypeSpace
+from rpython.rlib.debug import ll_assert, debug_print, debug_start, debug_stop
 
 DEBUG_WRAPPER = True
 
@@ -974,6 +975,8 @@
         # we hope that malloc removal removes the newtuple() that is
         # inserted exactly here by the varargs specializer
 
+        print "start to pypy"
+
         # see "Handling of the GIL" above (careful, we don't have the GIL here)
         tid = rthread.get_or_make_ident()
         _gil_auto = False
@@ -1085,6 +1088,9 @@
         rffi.stackcounter.stacks_counter -= 1
 
         _restore_gil_state(pygilstate_release, gilstate, gil_release, 
_gil_auto, tid)
+
+        print "end to pypy"
+
         return retval
 
     wrapper_second_level._dont_inline_ = True
@@ -1773,8 +1779,10 @@
 
         preexist_error = PyErr_Occurred(space)
         try:
+            print "start cpyext_call"
             # Call the function
             result = call_external_function(func, *boxed_args)
+            print "end cpyext_call"
         finally:
             assert cpyext_glob_tid_ptr[0] == tid
             cpyext_glob_tid_ptr[0] = tid_before
diff --git a/rpython/config/translationoption.py 
b/rpython/config/translationoption.py
--- a/rpython/config/translationoption.py
+++ b/rpython/config/translationoption.py
@@ -105,6 +105,14 @@
                      "asmgcc": [("translation.gctransformer", "framework"),
                                 ("translation.backend", "c")],
                     }),
+    ChoiceOption("cpyextgc", "Garbage Collection Strategy for cpyext",
+                 ["boehm", "ref", "ref_trialdel", "none"],
+                 default="ref",
+                 requires={
+                    "boehm": [("translation.gc", "incminimark")],
+                    "ref_trialdel": [("translation.gc", "incminimark")],
+                 },
+                 cmdline="--cpyextgc"),
 
     # other noticeable options
     BoolOption("thread", "enable use of threading primitives",
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
@@ -177,6 +177,8 @@
         defines = defines.copy()
         if self.config.translation.countmallocs:
             defines['COUNT_OP_MALLOCS'] = 1
+        if self.config.translation.cpyextgc == "boehm":
+            defines['CPYEXT_BOEHM'] = 1
         if self.config.translation.sandbox:
             defines['RPY_SANDBOXED'] = 1
         if CBuilder.have___thread is None:
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to