Skip to content

Commit cfcd9fe

Browse files
committed
Revive free-threaded build to be built.
1 parent d470ce9 commit cfcd9fe

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

Include/internal/pycore_stackref.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,12 @@ PyStackRef_CLOSE_SPECIALIZED(_PyStackRef ref, destructor destruct)
464464
PyStackRef_CLOSE(ref);
465465
}
466466

467+
static inline int
468+
PyStackRef_RefcountOnObject(_PyStackRef ref)
469+
{
470+
return (ref.bits & Py_TAG_REFCNT) == 0;
471+
}
472+
467473
static inline _PyStackRef
468474
PyStackRef_DUP(_PyStackRef stackref)
469475
{

Python/optimizer.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ _PyOptimizer_Optimize(
119119
PyInterpreterState *interp = _PyInterpreterState_GET();
120120
assert(interp->jit);
121121
assert(!interp->compiling);
122+
#ifndef Py_GIL_DISABLED
122123
interp->compiling = true;
123124
// The first executor in a chain and the MAX_CHAIN_DEPTH'th executor *must*
124125
// make progress in order to avoid infinite loops or excessively-long
@@ -160,6 +161,9 @@ _PyOptimizer_Optimize(
160161
assert((*executor_ptr)->vm_data.valid);
161162
interp->compiling = false;
162163
return 1;
164+
#else
165+
return 0;
166+
#endif
163167
}
164168

165169
static _PyExecutorObject *

configure

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2799,7 +2799,7 @@ AC_MSG_RESULT([$tier2_flags $jit_flags])
27992799
if test "$disable_gil" = "yes" -a "$enable_experimental_jit" != "no"; then
28002800
# GH-133171: This configuration builds the JIT but never actually uses it,
28012801
# which is surprising (and strictly worse than not building it at all):
2802-
AC_MSG_ERROR([--enable-experimental-jit cannot be used with --disable-gil.])
2802+
AC_MSG_WARN([--enable-experimental-jit does not work correctly with --disable-gil.])
28032803
fi
28042804

28052805
case "$ac_cv_cc_name" in

0 commit comments

Comments
 (0)