mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03: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
|
|
@ -41,12 +41,26 @@ extern void _PyEval_InitState(PyInterpreterState *, PyThread_type_lock);
|
|||
extern void _PyEval_FiniState(struct _ceval_state *ceval);
|
||||
extern void _PyEval_SignalReceived(PyInterpreterState *interp);
|
||||
|
||||
// bitwise flags:
|
||||
#define _Py_PENDING_MAINTHREADONLY 1
|
||||
#define _Py_PENDING_RAWFREE 2
|
||||
|
||||
// Export for '_testinternalcapi' shared extension
|
||||
PyAPI_FUNC(int) _PyEval_AddPendingCall(
|
||||
PyInterpreterState *interp,
|
||||
_Py_pending_call_func func,
|
||||
void *arg,
|
||||
int mainthreadonly);
|
||||
int flags);
|
||||
|
||||
typedef int (*_Py_simple_func)(void *);
|
||||
extern int _Py_CallInInterpreter(
|
||||
PyInterpreterState *interp,
|
||||
_Py_simple_func func,
|
||||
void *arg);
|
||||
extern int _Py_CallInInterpreterAndRawFree(
|
||||
PyInterpreterState *interp,
|
||||
_Py_simple_func func,
|
||||
void *arg);
|
||||
|
||||
extern void _PyEval_SignalAsyncExc(PyInterpreterState *interp);
|
||||
#ifdef HAVE_FORK
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ struct _pending_calls {
|
|||
struct _pending_call {
|
||||
_Py_pending_call_func func;
|
||||
void *arg;
|
||||
int flags;
|
||||
} calls[NPENDINGCALLS];
|
||||
int first;
|
||||
int last;
|
||||
|
|
|
|||
|
|
@ -267,7 +267,8 @@ _PyInterpreterState_SetFinalizing(PyInterpreterState *interp, PyThreadState *tst
|
|||
}
|
||||
|
||||
|
||||
extern PyInterpreterState* _PyInterpreterState_LookUpID(int64_t);
|
||||
// Export for the _xxinterpchannels module.
|
||||
PyAPI_FUNC(PyInterpreterState *) _PyInterpreterState_LookUpID(int64_t);
|
||||
|
||||
extern int _PyInterpreterState_IDInitref(PyInterpreterState *);
|
||||
extern int _PyInterpreterState_IDIncref(PyInterpreterState *);
|
||||
|
|
|
|||
21
Include/internal/pycore_pybuffer.h
Normal file
21
Include/internal/pycore_pybuffer.h
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#ifndef Py_INTERNAL_PYBUFFER_H
|
||||
#define Py_INTERNAL_PYBUFFER_H
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef Py_BUILD_CORE
|
||||
# error "this header requires Py_BUILD_CORE define"
|
||||
#endif
|
||||
|
||||
|
||||
// Exported for the _xxinterpchannels module.
|
||||
PyAPI_FUNC(int) _PyBuffer_ReleaseInInterpreter(
|
||||
PyInterpreterState *interp, Py_buffer *view);
|
||||
PyAPI_FUNC(int) _PyBuffer_ReleaseInInterpreterAndRawFree(
|
||||
PyInterpreterState *interp, Py_buffer *view);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* !Py_INTERNAL_PYBUFFER_H */
|
||||
Loading…
Add table
Add a link
Reference in a new issue