Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r63014:c0808fc03a3a
Date: 2013-04-04 21:56 +0200
http://bitbucket.org/pypy/pypy/changeset/c0808fc03a3a/

Log:    Move gc_stack_bottom() around to after the GIL is acquired and the
        stacks_counter is increased. Now c/gcc/test passes. And now,
        test_zrpy_releasegil no longer passes, as expected.

diff --git a/rpython/rtyper/lltypesystem/rffi.py 
b/rpython/rtyper/lltypesystem/rffi.py
--- a/rpython/rtyper/lltypesystem/rffi.py
+++ b/rpython/rtyper/lltypesystem/rffi.py
@@ -282,13 +282,13 @@
     args = ', '.join(['a%d' % i for i in range(len(TP.TO.ARGS))])
     source = py.code.Source(r"""
         def wrapper(%(args)s):    # no *args - no GIL for mallocing the tuple
-            llop.gc_stack_bottom(lltype.Void)   # marker for trackgcroot.py
             if aroundstate is not None:
                 after = aroundstate.after
                 if after:
                     after()
             # from now on we hold the GIL
             stackcounter.stacks_counter += 1
+            llop.gc_stack_bottom(lltype.Void)   # marker for trackgcroot.py
             try:
                 result = callable(%(args)s)
             except Exception, e:
diff --git a/rpython/translator/c/src/mem.h b/rpython/translator/c/src/mem.h
--- a/rpython/translator/c/src/mem.h
+++ b/rpython/translator/c/src/mem.h
@@ -210,7 +210,7 @@
         got += 1;
         fd = ((void* *) (((char *)fd) + sizeof(void*)))[0];
     }
-    assert(got == stacks_counter || ((got == 0) && (stacks_counter == 1)));
+    assert(got == stacks_counter - 1);
 #endif
 }
 
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to