Nick Coghlan <ncogh...@gmail.com> added the comment:

It's OK if the Py_buffer is on the stack - it's just a unique identifier for 
the exporter to use as a key, not something the exporter controls the lifecycle 
of (the latter is true only for the pointers *inside* the struct, such as buf, 
shape, strides, etc).

PyMemoryView_FromBuffer should be calling PyObject_Getbuffer on the view->obj 
member (it's one of the things that embedding the reference allows, just as it 
allowed removal of the separate obj argument from the PyObject_ReleaseBuffer 
signature). That way the source object knows there is now a *second* Py_buffer 
struct kicking around, and can decide whether to re-use the same internal 
pointers or create new ones.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue10181>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to