numpy 2.0.0
src/multiarray/buffer.h File Reference

Go to the source code of this file.

Functions

NPY_NO_EXPORT void _array_dealloc_buffer_info (PyArrayObject *self)
NPY_NO_EXPORT PyArray_Descr_descriptor_from_pep3118_format (char *s)

Variables

NPY_NO_EXPORT PyBufferProcs array_as_buffer

Function Documentation

NPY_NO_EXPORT void _array_dealloc_buffer_info ( PyArrayObject self)
System Message: SEVERE/4 (<string>, line 1)
Missing matching underline for section title overline.

 PEP 3118 buffer protocol
 

<blockquote>

Implementing PEP 3118 is somewhat convoluted because of the desirata:

  • Don't add new members to ndarray or descr structs, to preserve binary compatibility. (Also, adding the items is actually not very useful, since mutability issues prevent an 1 to 1 relationship between arrays and buffer views.)
  • Don't use bf_releasebuffer, because it prevents PyArg_ParseTuple("s#", ... from working. Breaking this would cause several backward compatibility issues already on Python 2.6.
  • Behave correctly when array is reshaped in-place, or it's dtype is altered.
The solution taken below is to manually track memory allocated for Py_buffers. </blockquote>

System Message: WARNING/2 (<string>, line 20) Block quote ends without a blank line; unexpected unindent.

System Message: ERROR/3 (<string>, line 20) Document may not end with a transition.
NPY_NO_EXPORT PyArray_Descr* _descriptor_from_pep3118_format ( char *  s)
System Message: SEVERE/4 (<string>, line 1)
Incomplete section title.

 Convert PEP 3118 format string to PyArray_Descr

Variable Documentation

NPY_NO_EXPORT PyBufferProcs array_as_buffer