Skip to content

Commit 26a7420

Browse files
authored
GH-118093: Fix off-by-one errors in tier-up thresholds (GH-124447)
1 parent 9c7657f commit 26a7420

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Include/internal/pycore_backoff.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ backoff_counter_triggers(_Py_BackoffCounter counter)
108108
/* Initial JUMP_BACKWARD counter.
109109
* This determines when we create a trace for a loop.
110110
* Backoff sequence 16, 32, 64, 128, 256, 512, 1024, 2048, 4096. */
111-
#define JUMP_BACKWARD_INITIAL_VALUE 16
111+
#define JUMP_BACKWARD_INITIAL_VALUE 15
112112
#define JUMP_BACKWARD_INITIAL_BACKOFF 4
113113
static inline _Py_BackoffCounter
114114
initial_jump_backoff_counter(void)
@@ -122,7 +122,7 @@ initial_jump_backoff_counter(void)
122122
* otherwise when a side exit warms up we may construct
123123
* a new trace before the Tier 1 code has properly re-specialized.
124124
* Backoff sequence 64, 128, 256, 512, 1024, 2048, 4096. */
125-
#define SIDE_EXIT_INITIAL_VALUE 64
125+
#define SIDE_EXIT_INITIAL_VALUE 63
126126
#define SIDE_EXIT_INITIAL_BACKOFF 6
127127

128128
static inline _Py_BackoffCounter

0 commit comments

Comments
 (0)