Skip to content

Commit

Permalink
move getbufferproc and releasebufferproc to pybuffer.h
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhewitt committed Oct 27, 2022
1 parent 6ffb4e2 commit eae6de2
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
2 changes: 2 additions & 0 deletions Doc/data/stable_abi.dat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions Include/cpython/object.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ typedef struct _Py_Identifier {

#endif /* NEEDS_PY_IDENTIFIER */

typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
typedef void (*releasebufferproc)(PyObject *, Py_buffer *);


typedef struct {
/* Number implementations must check *both*
arguments for proper type and implement the necessary conversions
Expand Down
3 changes: 3 additions & 0 deletions Include/pybuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ typedef struct {
void *internal;
} Py_buffer;

typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
typedef void (*releasebufferproc)(PyObject *, Py_buffer *);

/* Return 1 if the getbuffer function is available, otherwise return 0. */
PyAPI_FUNC(int) PyObject_CheckBuffer(PyObject *obj);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add ``getbufferproc`` and ``releasebufferproc`` to the stable API.
4 changes: 4 additions & 0 deletions Misc/stable_abi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2293,3 +2293,7 @@
added = '3.12'
[typedef.vectorcallfunc]
added = '3.12'
[typedef.getbufferproc]
added = '3.12'
[typedef.releasebufferproc]
added = '3.12'

0 comments on commit eae6de2

Please sign in to comment.