summaryrefslogtreecommitdiffstats
path: root/Python/ceval_macros.h
diff options
context:
space:
mode:
authorBrett Simmers <swtaarrs@users.noreply.github.com>2024-03-01 02:53:32 (GMT)
committerGitHub <noreply@github.com>2024-03-01 02:53:32 (GMT)
commit339c8e1c13adc299a0e2e49c93067e7817692380 (patch)
tree4d2c0708d04ea383b533115e83ec4f49fbf826e7 /Python/ceval_macros.h
parent2e94a6687c1a9750e9d2408a8dff0a422aeaf0e4 (diff)
downloadcpython-339c8e1c13adc299a0e2e49c93067e7817692380.zip
cpython-339c8e1c13adc299a0e2e49c93067e7817692380.tar.gz
cpython-339c8e1c13adc299a0e2e49c93067e7817692380.tar.bz2
gh-115999: Disable the specializing adaptive interpreter in free-threaded builds (#116013)
For now, disable all specialization when the GIL might be disabled.
Diffstat (limited to 'Python/ceval_macros.h')
-rw-r--r--Python/ceval_macros.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/Python/ceval_macros.h b/Python/ceval_macros.h
index 9674a78..b024b51 100644
--- a/Python/ceval_macros.h
+++ b/Python/ceval_macros.h
@@ -296,11 +296,19 @@ GETITEM(PyObject *v, Py_ssize_t i) {
#define ADAPTIVE_COUNTER_IS_MAX(COUNTER) \
(((COUNTER) >> ADAPTIVE_BACKOFF_BITS) == ((1 << MAX_BACKOFF_VALUE) - 1))
+#ifdef Py_GIL_DISABLED
+#define DECREMENT_ADAPTIVE_COUNTER(COUNTER) \
+ do { \
+ /* gh-115999 tracks progress on addressing this. */ \
+ static_assert(0, "The specializing interpreter is not yet thread-safe"); \
+ } while (0);
+#else
#define DECREMENT_ADAPTIVE_COUNTER(COUNTER) \
do { \
assert(!ADAPTIVE_COUNTER_IS_ZERO((COUNTER))); \
(COUNTER) -= (1 << ADAPTIVE_BACKOFF_BITS); \
} while (0);
+#endif
#define INCREMENT_ADAPTIVE_COUNTER(COUNTER) \
do { \