summaryrefslogtreecommitdiffstats
path: root/Objects/abstract.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/abstract.c')
-rw-r--r--Objects/abstract.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c
index 55d3b3a..806ca65 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -2,6 +2,7 @@
#include "Python.h"
#include "pycore_abstract.h" // _PyIndex_Check()
+#include "pycore_pybuffer.h"
#include "pycore_call.h" // _PyObject_CallNoArgs()
#include "pycore_ceval.h" // _Py_EnterRecursiveCallTstate()
#include "pycore_object.h" // _Py_CheckSlotResult()
@@ -806,6 +807,27 @@ PyBuffer_Release(Py_buffer *view)
Py_DECREF(obj);
}
+static int
+_buffer_release_call(void *arg)
+{
+ PyBuffer_Release((Py_buffer *)arg);
+ return 0;
+}
+
+int
+_PyBuffer_ReleaseInInterpreter(PyInterpreterState *interp,
+ Py_buffer *view)
+{
+ return _Py_CallInInterpreter(interp, _buffer_release_call, view);
+}
+
+int
+_PyBuffer_ReleaseInInterpreterAndRawFree(PyInterpreterState *interp,
+ Py_buffer *view)
+{
+ return _Py_CallInInterpreterAndRawFree(interp, _buffer_release_call, view);
+}
+
PyObject *
PyObject_Format(PyObject *obj, PyObject *format_spec)
{