Skip to content

Commit

Permalink
Redo how the #define works
Browse files Browse the repository at this point in the history
  • Loading branch information
mdboom committed Oct 16, 2024
1 parent d4f661e commit ec692b1
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Python/ceval.c
Original file line number Diff line number Diff line change
Expand Up @@ -767,13 +767,14 @@ _PyObjectArray_Free(PyObject **array, PyObject **scratch)
this function only. If this is fixed upstream, we should gate this on the
version of MSVC.
*/
#define DO_NOT_OPTIMIZE_INTERP_LOOP ( \
(defined(_MSC_VER) && \
#if (defined(_MSC_VER) && \
defined(_Py_USING_PGO) && \
(defined(_Py_JIT) || \
defined(Py_GIL_DISABLED))))
defined(Py_GIL_DISABLED)))
#define DO_NOT_OPTIMIZE_INTERP_LOOP
#endif

#if DO_NOT_OPTIMIZE_INTERP_LOOP
#ifdef DO_NOT_OPTIMIZE_INTERP_LOOP
# pragma optimize("t", off)
/* This setting is reversed below following _PyEval_EvalFrameDefault */
#endif
Expand Down Expand Up @@ -1153,7 +1154,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int

}

#if DO_NOT_OPTIMIZE_INTERP_LOOP
#ifdef DO_NOT_OPTIMIZE_INTERP_LOOP
# pragma optimize("", on)
#endif

Expand Down

0 comments on commit ec692b1

Please sign in to comment.