[pypy-commit] pypy cffi-static-callback: merge heads

arigo noreply at buildbot.pypy.org
Mon Nov 16 10:02:53 EST 2015


Author: Armin Rigo <arigo at tunes.org>
Branch: cffi-static-callback
Changeset: r80714:f501098f4870
Date: 2015-11-16 14:23 +0000
http://bitbucket.org/pypy/pypy/changeset/f501098f4870/

Log:	merge heads

diff --git a/pypy/module/_cffi_backend/call_python.py b/pypy/module/_cffi_backend/call_python.py
--- a/pypy/module/_cffi_backend/call_python.py
+++ b/pypy/module/_cffi_backend/call_python.py
@@ -3,6 +3,7 @@
 from rpython.rlib.rarithmetic import intmask
 from rpython.rlib import jit
 from rpython.rtyper.lltypesystem import lltype, rffi
+from rpython.rtyper.lltypesystem.lloperation import llop
 from rpython.rtyper.annlowlevel import llhelper
 
 from pypy.interpreter.error import oefmt
@@ -39,6 +40,12 @@
     """
     from pypy.module._cffi_backend.ccallback import reveal_callback
 
+    after = rffi.aroundstate.after
+    if after:
+        after()
+    rffi.stackcounter.stacks_counter += 1
+    llop.gc_stack_bottom(lltype.Void)   # marker for trackgcroot.py
+
     cerrno._errno_after(rffi.RFFI_ERR_ALL | rffi.RFFI_ALT_ERRNO)
 
     if not ll_callpy.c_reserved1:
@@ -63,6 +70,11 @@
 
     cerrno._errno_before(rffi.RFFI_ERR_ALL | rffi.RFFI_ALT_ERRNO)
 
+    rffi.stackcounter.stacks_counter -= 1
+    before = rffi.aroundstate.before
+    if before:
+        before()
+
 
 def get_ll_cffi_call_python():
     return llhelper(lltype.Ptr(CALLPY_FN), _cffi_call_python)


More information about the pypy-commit mailing list