This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author sbt
Recipients amaury.forgeotdarc, jcea, pitrou, sbt, skrah
Date 2012-09-18.20:47:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1348001275.47.0.26214243454.issue15903@psf.upfronthosting.co.za>
In-reply-to
Content
> You would need to call memory_release(). Perhaps we can just expose it on the
> C-API level as PyMemoryView_Release().

Should PyMemoryView_Release() release the _PyManagedBufferObject by doing mbuf_release(view->mbuf) even if view->mbuf->exports > 0?

Doing

  Py_TYPE(view->mbuf)->tp_clear((PyObject *)view->mbuf);

seems to have the desired effect of causing ValueError when I try to access any associated memoryview.

>  3) A piece of memory needs to be packaged as a memoryview with automatic
>     cleanup in mbuf_dealloc():
>
>        PyMemoryView_FromBufferWithCleanup() (proposed in msg169613)

Maybe this should also handle decrefing the base object (given a flag PyManagedBuffer_FreeObj).  I do worry about creating memoryviews that survive deallocation of the base object.
History
Date User Action Args
2012-09-18 20:47:55sbtsetrecipients: + sbt, jcea, amaury.forgeotdarc, pitrou, skrah
2012-09-18 20:47:55sbtsetmessageid: <1348001275.47.0.26214243454.issue15903@psf.upfronthosting.co.za>
2012-09-18 20:47:55sbtlinkissue15903 messages
2012-09-18 20:47:54sbtcreate