Author: Maciej Fijalkowski <[email protected]>
Branch: gc-minimark-pinning
Changeset: r54665:ad9787fabbde
Date: 2012-04-23 12:31 +0200
http://bitbucket.org/pypy/pypy/changeset/ad9787fabbde/

Log:    a slight dance with keepalives

diff --git a/pypy/rpython/lltypesystem/rffi.py 
b/pypy/rpython/lltypesystem/rffi.py
--- a/pypy/rpython/lltypesystem/rffi.py
+++ b/pypy/rpython/lltypesystem/rffi.py
@@ -741,11 +741,11 @@
         # if 'buf' points inside 'data'.  This is only possible if we
         # followed the 2nd case in get_nonmovingbuffer(); in the first case,
         # 'buf' points to its own raw-malloced memory.
-        keepalive_until_here(data)
         if pinned:
             rgc.unpin(data)
-        elif is_raw:
+        if is_raw:
             lltype.free(buf, flavor='raw')
+        keepalive_until_here(data)
     free_nonmovingbuffer._annenforceargs_ = [strtype, None, bool, bool]
 
     # int -> (char*, str)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to