Skip to content

gh-98410: move getbufferproc and releasebufferproc to buffer.h #31158

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'