Message404402
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. |
|
Date |
User |
Action |
Args |
2021-10-20 08:30:16 | christian.heimes | set | recipients:
+ christian.heimes, pitrou, vstinner, petr.viktorin, skrah, serhiy.storchaka |
2021-10-20 08:30:16 | christian.heimes | set | messageid: <1634718616.19.0.151642689263.issue45459@roundup.psfhosted.org> |
2021-10-20 08:30:16 | christian.heimes | link | issue45459 messages |
2021-10-20 08:30:16 | christian.heimes | create | |
|