From 3db0a21f731cec28a89f7495a82ee2670bce75fe Mon Sep 17 00:00:00 2001 From: mpage Date: Tue, 22 Nov 2022 04:06:44 -0800 Subject: gh-91053: Add an optional callback that is invoked whenever a function is modified (#98175) --- Include/internal/pycore_interp.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Include/internal/pycore_interp.h') diff --git a/Include/internal/pycore_interp.h b/Include/internal/pycore_interp.h index 437bf74b77..532b284990 100644 --- a/Include/internal/pycore_interp.h +++ b/Include/internal/pycore_interp.h @@ -17,6 +17,7 @@ extern "C" { #include "pycore_dict_state.h" // struct _Py_dict_state #include "pycore_exceptions.h" // struct _Py_exc_state #include "pycore_floatobject.h" // struct _Py_float_state +#include "pycore_function.h" // FUNC_MAX_WATCHERS #include "pycore_genobject.h" // struct _Py_async_gen_state #include "pycore_gc.h" // struct _gc_runtime_state #include "pycore_list.h" // struct _Py_list_state @@ -171,6 +172,11 @@ struct _is { // Initialized to _PyEval_EvalFrameDefault(). _PyFrameEvalFunction eval_frame; + PyDict_WatchCallback dict_watchers[DICT_MAX_WATCHERS]; + PyFunction_WatchCallback func_watchers[FUNC_MAX_WATCHERS]; + // One bit is set for each non-NULL entry in func_watchers + uint8_t active_func_watchers; + Py_ssize_t co_extra_user_count; freefunc co_extra_freefuncs[MAX_CO_EXTRA_USERS]; -- cgit v1.2.1