diff options
author | Itamar Ostricher <itamarost@gmail.com> | 2022-12-02 17:28:27 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-02 17:28:27 (GMT) |
commit | 3c137dc613c860f605d3520d7fd722cd8ed79da6 (patch) | |
tree | 1d790ed26497a0f7c5262a4a00ca6311cf3950e9 /Python/pystate.c | |
parent | 0563be23a557917228a8b48cbb31bda285a3a815 (diff) | |
download | cpython-3c137dc613c860f605d3520d7fd722cd8ed79da6.zip cpython-3c137dc613c860f605d3520d7fd722cd8ed79da6.tar.gz cpython-3c137dc613c860f605d3520d7fd722cd8ed79da6.tar.bz2 |
GH-91054: Add code object watchers API (GH-99859)
* Add API to allow extensions to set callback function on creation and destruction of PyCodeObject
Co-authored-by: Ye11ow-Flash <janshah@cs.stonybrook.edu>
Diffstat (limited to 'Python/pystate.c')
-rw-r--r-- | Python/pystate.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Python/pystate.c b/Python/pystate.c index 19fd9a6..793ba91 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -466,6 +466,11 @@ interpreter_clear(PyInterpreterState *interp, PyThreadState *tstate) } interp->active_func_watchers = 0; + for (int i=0; i < CODE_MAX_WATCHERS; i++) { + interp->code_watchers[i] = NULL; + } + interp->active_code_watchers = 0; + // XXX Once we have one allocator per interpreter (i.e. // per-interpreter GC) we must ensure that all of the interpreter's // objects have been cleaned up at the point. |