Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Modules/_testinternalcapi/test_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Objects/unicodeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -14737,7 +14737,7 @@ intern_common(PyInterpreterState *interp, PyObject *s /* stolen */,
/* Statically allocated strings must be already interned. */
assert(!_PyUnicode_STATE(s).statically_allocated);

#if Py_GIL_DISABLED
#ifdef Py_GIL_DISABLED
/* In the free-threaded build, all interned strings are immortal */
immortalize = 1;
#endif
Expand Down
4 changes: 1 addition & 3 deletions PC/pyconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,15 @@ WIN32 is still required for the locale module.
#endif

/* Define to 1 when compiling for experimental free-threaded builds */
#ifdef Py_GIL_DISABLED
#if defined(Py_GIL_DISABLED) && Py_GIL_DISABLED == 0
/* We undefine if it was set to zero because all later checks are #ifdef.
* Note that non-Windows builds do not do this, and so every effort should
* be made to avoid defining the variable at all when not desired. However,
* sysconfig.get_config_var always returns a 1 or a 0, and so it seems likely
* that a build backend will define it with the value.
*/
#if Py_GIL_DISABLED == 0
#undef Py_GIL_DISABLED
#endif
#endif

/* Compiler specific defines */

Expand Down
4 changes: 2 additions & 2 deletions Python/bytecodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -2278,7 +2278,7 @@ dummy_func(
assert(index < DK_SIZE(keys));
PyObject *res_o = FT_ATOMIC_LOAD_PTR_CONSUME(entries[index].me_value);
DEOPT_IF(res_o == NULL);
#if Py_GIL_DISABLED
#ifdef Py_GIL_DISABLED
int increfed = _Py_TryIncrefCompareStackRef(&entries[index].me_value, res_o, &res);
DEOPT_IF(!increfed);
#else
Expand All @@ -2297,7 +2297,7 @@ dummy_func(
PyDictUnicodeEntry *entries = DK_UNICODE_ENTRIES(keys);
PyObject *res_o = FT_ATOMIC_LOAD_PTR_CONSUME(entries[index].me_value);
DEOPT_IF(res_o == NULL);
#if Py_GIL_DISABLED
#ifdef Py_GIL_DISABLED
int increfed = _Py_TryIncrefCompareStackRef(&entries[index].me_value, res_o, &res);
DEOPT_IF(!increfed);
#else
Expand Down
4 changes: 2 additions & 2 deletions Python/executor_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Python/generated_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Python/lock.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ static const PyTime_t TIME_TO_BE_FAIR_NS = 1000*1000;
// Spin for a bit before parking the thread. This is only enabled for
// `--disable-gil` builds because it is unlikely to be helpful if the GIL is
// enabled.
#if Py_GIL_DISABLED
#ifdef Py_GIL_DISABLED
static const int MAX_SPIN_COUNT = 40;
#else
static const int MAX_SPIN_COUNT = 0;
Expand Down
2 changes: 1 addition & 1 deletion Python/modsupport.c
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@ int PyABIInfo_Check(PyABIInfo *info, const char *module_name)

/* Free-threading/GIL */
uint16_t gilflags = info->flags & (PyABIInfo_GIL | PyABIInfo_FREETHREADED);
#if Py_GIL_DISABLED
#ifdef Py_GIL_DISABLED
if (gilflags == PyABIInfo_GIL) {
return _abiinfo_raise(module_name,
"incompatible with free-threaded CPython");
Expand Down
Loading