Message125499
| Author |
ncoghlan |
| Recipients |
kermode, loewis, mark.dickinson, ncoghlan, pitrou, rupole, teoliphant |
| Date |
2011年01月06日.02:09:52 |
| SpamBayes Score |
2.7030617e-07 |
| Marked as misclassified |
No |
| Message-id |
<1294279802.37.0.800965322257.issue10181@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|