[pypy-commit] pypy issue2444: remove cyclic reference, w_obj <-> pymemobj, view = pymemobj.c_view

mattip pypy.commits at gmail.com
Mon Dec 26 13:32:46 EST 2016


Author: Matti Picus <matti.picus at gmail.com>
Branch: issue2444
Changeset: r89236:b9a117c04b7c
Date: 2016-12-26 19:51 +0200
http://bitbucket.org/pypy/pypy/changeset/b9a117c04b7c/

Log:	remove cyclic reference, w_obj <-> pymemobj, view = pymemobj.c_view

diff --git a/pypy/module/cpyext/memoryobject.py b/pypy/module/cpyext/memoryobject.py
--- a/pypy/module/cpyext/memoryobject.py
+++ b/pypy/module/cpyext/memoryobject.py
@@ -97,7 +97,7 @@
     fill_Py_buffer(space, w_obj.buf, view)
     try:
         view.c_buf = rffi.cast(rffi.VOIDP, w_obj.buf.get_raw_address())
-        view.c_obj = make_ref(space, w_obj)
+        #view.c_obj = make_ref(space, w_obj) # NO - this creates a ref cycle!
         rffi.setintfield(view, 'c_readonly', w_obj.buf.readonly)
         isstr = False
     except ValueError:


More information about the pypy-commit mailing list