From a2b0b3ca37398bef4e14d1c01ad049529a06937c Mon Sep 17 00:00:00 2001 From: Jukka Lehtosalo Date: Tue, 27 May 2025 17:39:28 +0100 Subject: [PATCH] [mypyc] Add comment about incref/decref and free-threaded builds --- mypyc/lib-rt/mypyc_util.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mypyc/lib-rt/mypyc_util.h b/mypyc/lib-rt/mypyc_util.h index 64bf025aec27..27a11ab9f581 100644 --- a/mypyc/lib-rt/mypyc_util.h +++ b/mypyc/lib-rt/mypyc_util.h @@ -38,6 +38,9 @@ // // Py_INCREF and other CPython operations check for immortality. This // can be expensive when we know that an object cannot be immortal. +// +// This optimization cannot be performed in free-threaded mode so we +// fall back to just calling the normal incref/decref operations. static inline void CPy_INCREF_NO_IMM(PyObject *op) {