GH-100000: Cleanup and polish various watchers code (GH-99998)

* Initialize `type_watchers` array to `NULL`s
* Optimize code watchers notification
* Optimize func watchers notification
This commit is contained in:
Itamar Ostricher 2022-12-14 11:14:16 -08:00 committed by GitHub
parent aa8591e9ca
commit ae83c78215
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 37 additions and 14 deletions

View file

@ -461,6 +461,10 @@ interpreter_clear(PyInterpreterState *interp, PyThreadState *tstate)
interp->dict_state.watchers[i] = NULL;
}
for (int i=0; i < TYPE_MAX_WATCHERS; i++) {
interp->type_watchers[i] = NULL;
}
for (int i=0; i < FUNC_MAX_WATCHERS; i++) {
interp->func_watchers[i] = NULL;
}