Skip to content

Commit

Permalink
pythongh-98410: move getbufferproc and releasebufferproc to buffer.h (p…
Browse files Browse the repository at this point in the history
…ython#31158)

This adds them to the Limited API.
  • Loading branch information
davidhewitt authored Oct 31, 2022
1 parent a41de32 commit e98923c
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 @@ -2299,3 +2299,7 @@
added = '3.12'
[macro.PY_VECTORCALL_ARGUMENTS_OFFSET]
added = '3.12'
[typedef.getbufferproc]
added = '3.12'
[typedef.releasebufferproc]
added = '3.12'

0 comments on commit e98923c

Please sign in to comment.