mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
This is essentially a cleanup, moving a handful of API declarations to the header files where they fit best, creating new ones when needed. We do the following: * add pycore_debug_offsets.h and move _Py_DebugOffsets, etc. there * inline struct _getargs_runtime_state and struct _gilstate_runtime_state in _PyRuntimeState * move struct _reftracer_runtime_state to the existing pycore_object_state.h * add pycore_audit.h and move to it _Py_AuditHookEntry , _PySys_Audit(), and _PySys_ClearAuditHooks * add audit.h and cpython/audit.h and move the existing audit-related API there *move the perfmap/trampoline API from cpython/sysmodule.h to cpython/ceval.h, and remove the now-empty cpython/sysmodule.h
43 lines
1.6 KiB
C
43 lines
1.6 KiB
C
#ifndef Py_CPYTHON_CEVAL_H
|
|
# error "this header file must not be included directly"
|
|
#endif
|
|
|
|
PyAPI_FUNC(void) PyEval_SetProfile(Py_tracefunc, PyObject *);
|
|
PyAPI_FUNC(void) PyEval_SetProfileAllThreads(Py_tracefunc, PyObject *);
|
|
PyAPI_FUNC(void) PyEval_SetTrace(Py_tracefunc, PyObject *);
|
|
PyAPI_FUNC(void) PyEval_SetTraceAllThreads(Py_tracefunc, PyObject *);
|
|
|
|
/* Look at the current frame's (if any) code's co_flags, and turn on
|
|
the corresponding compiler flags in cf->cf_flags. Return 1 if any
|
|
flag was set, else return 0. */
|
|
PyAPI_FUNC(int) PyEval_MergeCompilerFlags(PyCompilerFlags *cf);
|
|
|
|
PyAPI_FUNC(PyObject *) _PyEval_EvalFrameDefault(PyThreadState *tstate, struct _PyInterpreterFrame *f, int exc);
|
|
|
|
PyAPI_FUNC(Py_ssize_t) PyUnstable_Eval_RequestCodeExtraIndex(freefunc);
|
|
// Old name -- remove when this API changes:
|
|
_Py_DEPRECATED_EXTERNALLY(3.12) static inline Py_ssize_t
|
|
_PyEval_RequestCodeExtraIndex(freefunc f) {
|
|
return PyUnstable_Eval_RequestCodeExtraIndex(f);
|
|
}
|
|
|
|
PyAPI_FUNC(int) _PyEval_SliceIndex(PyObject *, Py_ssize_t *);
|
|
PyAPI_FUNC(int) _PyEval_SliceIndexNotNone(PyObject *, Py_ssize_t *);
|
|
|
|
|
|
// Trampoline API
|
|
|
|
typedef struct {
|
|
FILE* perf_map;
|
|
PyThread_type_lock map_lock;
|
|
} PerfMapState;
|
|
|
|
PyAPI_FUNC(int) PyUnstable_PerfMapState_Init(void);
|
|
PyAPI_FUNC(int) PyUnstable_WritePerfMapEntry(
|
|
const void *code_addr,
|
|
unsigned int code_size,
|
|
const char *entry_name);
|
|
PyAPI_FUNC(void) PyUnstable_PerfMapState_Fini(void);
|
|
PyAPI_FUNC(int) PyUnstable_CopyPerfMapFile(const char* parent_filename);
|
|
PyAPI_FUNC(int) PyUnstable_PerfTrampoline_CompileCode(PyCodeObject *);
|
|
PyAPI_FUNC(int) PyUnstable_PerfTrampoline_SetPersistAfterFork(int enable);
|