[pypy-commit] pypy gc-minimark-pinning: a slight dance with keepalives

fijal noreply at buildbot.pypy.org
Mon Apr 23 12:32:11 CEST 2012


Author: Maciej Fijalkowski <fijall at gmail.com>
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)


More information about the pypy-commit mailing list