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 christian.heimes
Recipients christian.heimes, petr.viktorin, pitrou, serhiy.storchaka, skrah, vstinner
Date 2021-10-20.08:30:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1634718616.19.0.151642689263.issue45459@roundup.psfhosted.org>
In-reply-to
Content
A consumer will use the APIs:

---
Py_buffer *view;
int ndim;
const char *format;
const Py_ssize_t *shape, *strides, *suboffsets;
void *buf;

view = PyBuffer_New();
PyObject_GetBuffer(obj, view, flags);
ndim = PyBuffer_GetLayout(&format, &shape, &strides, &suboffsets);
buf = PyBuffer_GetPointer(view, [...]);
PyBuffer_Free(view); // also calls PyBuffer_Release()
---


The API functions PyBuffer_FillInfo(), PyBuffer_FillInfoEx(), and PyBuffer_GetInternal() are for exporters (producers)-only. The exporter uses the PyBuffer_FillInfo*() in its Py_bf_getbuffer function to fill the view. It may use PyBuffer_GetInternal() in its Py_bf_releasebuffer function to access the internal field and to release additional resources.
History
Date User Action Args
2021-10-20 08:30:16christian.heimessetrecipients: + christian.heimes, pitrou, vstinner, petr.viktorin, skrah, serhiy.storchaka
2021-10-20 08:30:16christian.heimessetmessageid: <1634718616.19.0.151642689263.issue45459@roundup.psfhosted.org>
2021-10-20 08:30:16christian.heimeslinkissue45459 messages
2021-10-20 08:30:16christian.heimescreate