diff options
author | Eric Snow <ericsnowcurrently@gmail.com> | 2023-10-09 13:39:51 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-09 13:39:51 (GMT) |
commit | 7bd560ce8de41e62230975c44fd7fbd189e8e858 (patch) | |
tree | 0d58bd28ecb0827591cf0c91a0a3cefc1de1926c /Include/internal | |
parent | f4cb0d27cc08f490c42a22e646eb73cc7072d54a (diff) | |
download | cpython-7bd560ce8de41e62230975c44fd7fbd189e8e858.zip cpython-7bd560ce8de41e62230975c44fd7fbd189e8e858.tar.gz cpython-7bd560ce8de41e62230975c44fd7fbd189e8e858.tar.bz2 |
gh-76785: Add SendChannel.send_buffer() (#110246)
(This is still a test module.)
Diffstat (limited to 'Include/internal')
-rw-r--r-- | Include/internal/pycore_ceval.h | 16 | ||||
-rw-r--r-- | Include/internal/pycore_ceval_state.h | 1 | ||||
-rw-r--r-- | Include/internal/pycore_interp.h | 3 | ||||
-rw-r--r-- | Include/internal/pycore_pybuffer.h | 21 |
4 files changed, 39 insertions, 2 deletions
diff --git a/Include/internal/pycore_ceval.h b/Include/internal/pycore_ceval.h index d3ea3a8..312d67e 100644 --- a/Include/internal/pycore_ceval.h +++ b/Include/internal/pycore_ceval.h @@ -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 diff --git a/Include/internal/pycore_ceval_state.h b/Include/internal/pycore_ceval_state.h index 47971fb..1717ec4 100644 --- a/Include/internal/pycore_ceval_state.h +++ b/Include/internal/pycore_ceval_state.h @@ -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; diff --git a/Include/internal/pycore_interp.h b/Include/internal/pycore_interp.h index 523dfdc..0beddbb 100644 --- a/Include/internal/pycore_interp.h +++ b/Include/internal/pycore_interp.h @@ -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 *); diff --git a/Include/internal/pycore_pybuffer.h b/Include/internal/pycore_pybuffer.h new file mode 100644 index 0000000..3cbc290 --- /dev/null +++ b/Include/internal/pycore_pybuffer.h @@ -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 */ |