[issue10181] Problems with Py_buffer management in memoryobject.c (and elsewhere?)

Nick Coghlan report at bugs.python.org
Tue Jul 5 16:37:02 CEST 2011


Nick Coghlan <ncoghlan at gmail.com> added the comment:

Moving this discussion out of the review comments:

Antoine is wanting to make release() nondeterministic by having the underlying buffer only released when all views using it either have release() called or are no longer referenced.

I contend that release() needs to mean "release the underlying memory *right now*" or it is completely pointless. The "I don't want to care about lifecycle issues" approach is already handled quite adequately by the ordinary refcounting semantics.

If ensuring that all references have been eliminated before release() is called is too much work for a user then the answer is simple: don't call release() and let the refcounting do the work.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10181>
_______________________________________


More information about the Python-bugs-list mailing list