[pypy-commit] pypy cpyext-nowrapper: (antocuni, ronan, armin) kill the @rgc.no_collect for now, as it doesn't do exactly what we need. Eventually we should probably write a custom graph analyzer, but for now we just ignore the issue and see how much we can go forward with this approach

antocuni pypy.commits at gmail.com
Sat Oct 7 09:08:14 EDT 2017


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: cpyext-nowrapper
Changeset: r92582:a11cce743736
Date: 2017-10-03 17:53 +0200
http://bitbucket.org/pypy/pypy/changeset/a11cce743736/

Log:	(antocuni, ronan, armin) kill the @rgc.no_collect for now, as it
	doesn't do exactly what we need. Eventually we should probably write
	a custom graph analyzer, but for now we just ignore the issue and
	see how much we can go forward with this approach

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
@@ -41,7 +41,6 @@
 from rpython.rlib import rthread
 from rpython.rlib.debug import fatalerror_notb
 from rpython.rlib import rstackovf
-from rpython.rlib import rgc
 from pypy.objspace.std.typeobject import W_TypeObject, find_best_base
 from pypy.module.cpyext.cparser import CTypeSpace
 
@@ -265,7 +264,7 @@
         no_gc=True means that this function is not allowed to do any operation
         which involves the GC; as a consequence, we can avoid emitting the
         wrapper. The net result is that calling this function from C is much
-        faster. This also implies @rgc.no_collect.
+        faster.
         """
         self.argtypes = argtypes
         self.restype = restype
@@ -280,7 +279,6 @@
         sig = pycode.cpython_code_signature(callable.func_code)
         if no_gc:
             self.argnames = sig.argnames
-            self.callable = rgc.no_collect(self.callable)
         else:
             assert sig.argnames[0] == 'space'
             self.argnames = sig.argnames[1:]
@@ -354,7 +352,6 @@
     def get_unwrapper(self):
         if self.no_gc:
             @specialize.ll()
-            @rgc.no_collect
             def unwrapper(*args):
                 # see "Handling of the GIL" above
                 tid = rthread.get_ident()
diff --git a/pypy/module/cpyext/pyobject.py b/pypy/module/cpyext/pyobject.py
--- a/pypy/module/cpyext/pyobject.py
+++ b/pypy/module/cpyext/pyobject.py
@@ -16,7 +16,6 @@
 from rpython.rtyper.annlowlevel import llhelper
 from rpython.rlib import rawrefcount, jit
 from rpython.rlib.debug import fatalerror
-from rpython.rlib import rgc
 
 
 #________________________________________________________
@@ -315,7 +314,6 @@
 def incref(space, obj):
     make_ref(space, obj)
 
- at rgc.no_collect
 def decref(obj):
     assert is_pyobj(obj)
     obj = rffi.cast(PyObject, obj)


More information about the pypy-commit mailing list