Add _PyBuffer_Release_in_interpreter().

This commit is contained in:
Eric Snow 2020-05-08 13:28:56 -06:00
parent 9849dc02fb
commit 1c0b35eb0e
2 changed files with 15 additions and 0 deletions

View File

@ -198,6 +198,8 @@ PyAPI_FUNC(const PyConfig*) _Py_GetConfig(void);
/* cross-interpreter operations */
PyAPI_FUNC(int) _Py_DECREF_in_interpreter(PyInterpreterState *, PyObject *);
PyAPI_FUNC(int) _PyBuffer_Release_in_interpreter(PyInterpreterState *,
Py_buffer *);
/* cross-interpreter data */

View File

@ -1495,6 +1495,19 @@ _Py_DECREF_in_interpreter(PyInterpreterState *interp, PyObject *obj)
return _PyEval_AddPendingCall(interp, _decref_pyobj, obj);
}
static int
_release_pybuf(void *view)
{
PyBuffer_Release((Py_buffer *)view);
return 0;
}
int
_PyBuffer_Release_in_interpreter(PyInterpreterState *interp, Py_buffer *view)
{
return _PyEval_AddPendingCall(interp, _release_pybuf, view);
}
/* cross-interpreter data */
crossinterpdatafunc _PyCrossInterpreterData_Lookup(PyObject *);