diff options
author | Mark Shannon <mark@hotpy.org> | 2023-11-09 13:49:51 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-09 13:49:51 +0000 |
commit | 34a03e951b027902d993c7066ba8e6b7e92cb2a9 (patch) | |
tree | 3a25738c13185ea521b0e8bad09e0ee2eda660a7 /Python/optimizer.c | |
parent | 25c49564880e6868e4c76602f9f1650f0bc71c75 (diff) | |
download | cpython-34a03e951b027902d993c7066ba8e6b7e92cb2a9.tar.gz cpython-34a03e951b027902d993c7066ba8e6b7e92cb2a9.zip |
GH-111843: Tier 2 exponential backoff (GH-111850)
Diffstat (limited to 'Python/optimizer.c')
-rw-r--r-- | Python/optimizer.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Python/optimizer.c b/Python/optimizer.c index 42279be3c1f..e142bd0488a 100644 --- a/Python/optimizer.c +++ b/Python/optimizer.c @@ -107,6 +107,7 @@ error_optimize( _PyExecutorObject **exec, int Py_UNUSED(stack_entries)) { + assert(0); PyErr_Format(PyExc_SystemError, "Should never call error_optimize"); return -1; } @@ -122,8 +123,8 @@ PyTypeObject _PyDefaultOptimizer_Type = { _PyOptimizerObject _PyOptimizer_Default = { PyObject_HEAD_INIT(&_PyDefaultOptimizer_Type) .optimize = error_optimize, - .resume_threshold = UINT16_MAX, - .backedge_threshold = UINT16_MAX, + .resume_threshold = INT16_MAX, + .backedge_threshold = INT16_MAX, }; _PyOptimizerObject * @@ -309,7 +310,7 @@ PyUnstable_Optimizer_NewCounter(void) return NULL; } opt->base.optimize = counter_optimize; - opt->base.resume_threshold = UINT16_MAX; + opt->base.resume_threshold = INT16_MAX; opt->base.backedge_threshold = 0; opt->count = 0; return (PyObject *)opt; @@ -915,7 +916,7 @@ PyUnstable_Optimizer_NewUOpOptimizer(void) return NULL; } opt->optimize = uop_optimize; - opt->resume_threshold = UINT16_MAX; + opt->resume_threshold = INT16_MAX; // Need at least 3 iterations to settle specializations. // A few lower bits of the counter are reserved for other flags. opt->backedge_threshold = 16 << OPTIMIZER_BITS_IN_COUNTER; |