mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-76785: Add SendChannel.send_buffer() (#110246)
(This is still a test module.)
This commit is contained in:
parent
f4cb0d27cc
commit
7bd560ce8d
13 changed files with 467 additions and 67 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue