Message170678
| Author |
skrah |
| Recipients |
amaury.forgeotdarc, jcea, pitrou, sbt, skrah, vstinner |
| Date |
2012年09月18日.21:19:26 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<20120918211928.GA25473@sleipnir.bytereef.org> |
| In-reply-to |
<1348001275.47.0.26214243454.issue15903@psf.upfronthosting.co.za> |
| Content |
Richard Oudkerk <report@bugs.python.org> wrote:
> Should PyMemoryView_Release() release the _PyManagedBufferObject by doing mbuf_release(view->mbuf) even if view->mbuf->exports > 0?
No, I think it should really just be a wrapper:
diff --git a/Objects/memoryobject.c b/Objects/memoryobject.c
--- a/Objects/memoryobject.c
+++ b/Objects/memoryobject.c
@@ -1093,6 +1093,12 @@
return memory_release((PyMemoryViewObject *)self, NULL);
}
+PyObject *
+PyMemoryView_Release(PyObject *m)
+{
+ return memory_release((PyMemoryViewObject *)m, NULL);
+}
+
We decided in #10181 not to allow releasing a view with exports, since the
logic is already quite complex. Is there a reasonable expectation that
existing code creates memoryviews of the readinto() argument? |
|