Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c83bc3c

Browse files
committed
Remove buffer API from stable ABI for now, see #10181.
1 parent e85da7a commit c83bc3c

5 files changed

Lines changed: 8 additions & 11 deletions

File tree

Include/abstract.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
488488

489489
/* new buffer API */
490490

491+
#ifndef Py_LIMITED_API
491492
#define PyObject_CheckBuffer(obj) \
492493
(((obj)->ob_type->tp_as_buffer != NULL) && \
493494
((obj)->ob_type->tp_as_buffer->bf_getbuffer != NULL))
@@ -575,6 +576,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
575576

576577
/* Releases a Py_buffer obtained from getbuffer ParseTuple's s*.
577578
*/
579+
#endif /* Py_LIMITED_API */
578580

579581
PyAPI_FUNC(PyObject *) PyObject_Format(PyObject* obj,
580582
PyObject *format_spec);

Include/memoryobject.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,11 @@ PyAPI_FUNC(PyObject *) PyMemoryView_GetContiguous(PyObject *base,
5555

5656
PyAPI_FUNC(PyObject *) PyMemoryView_FromObject(PyObject *base);
5757

58+
#ifndef Py_LIMITED_API
5859
PyAPI_FUNC(PyObject *) PyMemoryView_FromBuffer(Py_buffer *info);
5960
/* create new if bufptr is NULL
6061
will be a new bytesobject in base */
62+
#endif
6163

6264

6365
/* The struct is declared here so that macros can work, but it shouldn't

Include/object.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ typedef int(*ssizeobjargproc)(PyObject *, Py_ssize_t, PyObject *);
143143
typedef int(*ssizessizeobjargproc)(PyObject *, Py_ssize_t, Py_ssize_t, PyObject *);
144144
typedef int(*objobjargproc)(PyObject *, PyObject *, PyObject *);
145145

146-
146+
#ifndef Py_LIMITED_API
147147
/* buffer interface */
148148
typedef struct bufferinfo {
149149
void *buf;
@@ -195,6 +195,7 @@ typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
195195
#define PyBUF_WRITE 0x200
196196

197197
/* End buffer interface */
198+
#endif /* Py_LIMITED_API */
198199

199200
typedef int (*objobjproc)(PyObject *, PyObject *);
200201
typedef int (*visitproc)(PyObject *, void *);

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ What's New in Python 3.2 Release Candidate 1
88
Core and Builtins
99
-----------------
1010

11+
- Remove buffer API from stable ABI for now, see #10181.
12+
1113
- Issue #8651: PyArg_Parse*() functions raise an OverflowError if the file
1214
doesn't have PY_SSIZE_T_CLEAN define and the size doesn't fit in an int
1315
(length bigger than 2^31-1 bytes).

PC/python3.def

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,6 @@ EXPORTS
1010
PyBaseObject_Type=python32.PyBaseObject_Type DATA
1111
PyBool_FromLong=python32.PyBool_FromLong
1212
PyBool_Type=python32.PyBool_Type DATA
13-
PyBuffer_FillContiguousStrides=python32.PyBuffer_FillContiguousStrides
14-
PyBuffer_FillInfo=python32.PyBuffer_FillInfo
15-
PyBuffer_FromContiguous=python32.PyBuffer_FromContiguous
16-
PyBuffer_GetPointer=python32.PyBuffer_GetPointer
17-
PyBuffer_IsContiguous=python32.PyBuffer_IsContiguous
18-
PyBuffer_Release=python32.PyBuffer_Release
19-
PyBuffer_ToContiguous=python32.PyBuffer_ToContiguous
2013
PyByteArrayIter_Type=python32.PyByteArrayIter_Type DATA
2114
PyByteArray_AsString=python32.PyByteArray_AsString
2215
PyByteArray_Concat=python32.PyByteArray_Concat
@@ -317,7 +310,6 @@ EXPORTS
317310
PyMem_Malloc=python32.PyMem_Malloc
318311
PyMem_Realloc=python32.PyMem_Realloc
319312
PyMemberDescr_Type=python32.PyMemberDescr_Type DATA
320-
PyMemoryView_FromBuffer=python32.PyMemoryView_FromBuffer
321313
PyMemoryView_FromObject=python32.PyMemoryView_FromObject
322314
PyMemoryView_GetContiguous=python32.PyMemoryView_GetContiguous
323315
PyMemoryView_Type=python32.PyMemoryView_Type DATA
@@ -399,7 +391,6 @@ EXPORTS
399391
PyObject_CallObject=python32.PyObject_CallObject
400392
PyObject_CheckReadBuffer=python32.PyObject_CheckReadBuffer
401393
PyObject_ClearWeakRefs=python32.PyObject_ClearWeakRefs
402-
PyObject_CopyData=python32.PyObject_CopyData
403394
PyObject_DelItem=python32.PyObject_DelItem
404395
PyObject_DelItemString=python32.PyObject_DelItemString
405396
PyObject_Dir=python32.PyObject_Dir
@@ -412,7 +403,6 @@ EXPORTS
412403
PyObject_GenericSetAttr=python32.PyObject_GenericSetAttr
413404
PyObject_GetAttr=python32.PyObject_GetAttr
414405
PyObject_GetAttrString=python32.PyObject_GetAttrString
415-
PyObject_GetBuffer=python32.PyObject_GetBuffer
416406
PyObject_GetItem=python32.PyObject_GetItem
417407
PyObject_GetIter=python32.PyObject_GetIter
418408
PyObject_HasAttr=python32.PyObject_HasAttr

0 commit comments

Comments
 (0)