source = py.code.Source("""
before = aroundstate.before
- after = aroundstate.after
# NB. it is essential that no exception checking occurs here!
res = funcptr(%(argnames)s)
+ after = aroundstate.after
def wrapper(%s): # no *args - no GIL for mallocing the tuple
llop.gc_stack_bottom(lltype.Void) # marker for trackgcroot.py
if aroundstate is not None:
- before = aroundstate.before
after = aroundstate.after
# from now on we hold the GIL
stackcounter.stacks_counter += 1
stackcounter.stacks_counter -= 1
+ if aroundstate is not None:
+ before = aroundstate.before
# here we don't hold the GIL any more. As in the wrapper() produced
# by llexternal, it is essential that no exception checking occurs
# after the call to before().