Message170675
> 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. |
|
Date |
User |
Action |
Args |
2012-09-18 20:47:55 | sbt | set | recipients:
+ sbt, jcea, amaury.forgeotdarc, pitrou, skrah |
2012-09-18 20:47:55 | sbt | set | messageid: <1348001275.47.0.26214243454.issue15903@psf.upfronthosting.co.za> |
2012-09-18 20:47:55 | sbt | link | issue15903 messages |
2012-09-18 20:47:54 | sbt | create | |
|