gh-91053: Add an optional callback that is invoked whenever a function is modified (#98175)

This commit is contained in:
mpage 2022-11-22 04:06:44 -08:00 committed by GitHub
parent 20d9749a0f
commit 3db0a21f73
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 524 additions and 0 deletions

View file

@ -461,6 +461,11 @@ interpreter_clear(PyInterpreterState *interp, PyThreadState *tstate)
interp->dict_state.watchers[i] = NULL;
}
for (int i=0; i < FUNC_MAX_WATCHERS; i++) {
interp->func_watchers[i] = NULL;
}
interp->active_func_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.