Skip to content

Commit b0121bd

Browse files
itamarometa-codesync[bot]
authored andcommitted
Sync pre-release CPython main branch from GitHub (2026-08-13)
Summary: Imported python/cpython `3.16.0a0` from upstream rev [`ee4fe00`](https://www.github.com/python/cpython/commit/ee4fe00a8f72ea84a421bb626d7c78335c5c9ea1) (committed 2026-08-13 00:12:39+00:00). # Commit Info - Base: (`3.16.0a0`) - [`ee68f5f`](https://www.github.com/python/cpython/commit/ee68f5f46a14e2bbf22d72796e45e5f467951792) (commit date: 2026-08-11 23:16:05+00:00) - Imported: (`3.16.0a0`) - [`ee4fe00`](https://www.github.com/python/cpython/commit/ee4fe00a8f72ea84a421bb626d7c78335c5c9ea1) (commit date: 2026-08-13 00:12:39+00:00) # Noteworthy file changes - Native files (1 added): ``` + Modules/_testlimitedcapi/type.c ``` - Low-signal files (6 added) (NEWS.d, docs, .github) Complete list of added/removed files: https://www.internalfb.com/intern/everpaste/?color=0&handle=GA3qBC4DBoV2XdYEAKJh7cHWUH8Pbr0LAAAz Reviewed By: ambv Differential Revision: D115830379 fbshipit-source-id: f1747c799ca725bf5487ca2ea5e466e1a86105e8
1 parent 9f3bce1 commit b0121bd

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

cinderx/Interpreter/3.16/Includes/Python/ceval_macros.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,25 @@ static void dtrace_function_return(_PyInterpreterFrame *);
354354
#define ADAPTIVE_COUNTER_TRIGGERS(COUNTER) \
355355
backoff_counter_triggers(forge_backoff_counter((COUNTER)))
356356

357+
#ifdef Py_GIL_DISABLED
358+
/* Counters are unreachable when thread-local bytecode is disabled,
359+
* so there is no need to update them. */
360+
#define ADVANCE_ADAPTIVE_COUNTER(COUNTER) \
361+
do { \
362+
_Py_BackoffCounter cnt = (COUNTER); \
363+
if (!backoff_counter_is_unreachable(cnt)) { \
364+
(COUNTER) = advance_backoff_counter(cnt); \
365+
} \
366+
} while (0);
367+
368+
#define PAUSE_ADAPTIVE_COUNTER(COUNTER) \
369+
do { \
370+
_Py_BackoffCounter cnt = (COUNTER); \
371+
if (!backoff_counter_is_unreachable(cnt)) { \
372+
(COUNTER) = pause_backoff_counter(cnt); \
373+
} \
374+
} while (0);
375+
#else
357376
#define ADVANCE_ADAPTIVE_COUNTER(COUNTER) \
358377
do { \
359378
(COUNTER) = advance_backoff_counter((COUNTER)); \
@@ -363,6 +382,7 @@ static void dtrace_function_return(_PyInterpreterFrame *);
363382
do { \
364383
(COUNTER) = pause_backoff_counter((COUNTER)); \
365384
} while (0);
385+
#endif
366386

367387
#ifdef ENABLE_SPECIALIZATION
368388
/* Multiple threads may execute these concurrently if thread-local bytecode is

0 commit comments

Comments
 (0)