Skip to content

Commit bcd8563

Browse files
committed
Include uop_optimize only when not disabling the GIL.
1 parent 446edda commit bcd8563

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Python/optimizer.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,12 @@ insert_executor(PyCodeObject *code, _Py_CODEUNIT *instr, int index, _PyExecutorO
116116
static _PyExecutorObject *
117117
make_executor_from_uops(_PyThreadStateImpl *tstate, _PyUOpInstruction *buffer, int length, const _PyBloomFilter *dependencies);
118118

119+
#ifndef Py_GIL_DISABLED
119120
static int
120121
uop_optimize(_PyInterpreterFrame *frame, PyThreadState *tstate,
121122
_PyExecutorObject **exec_ptr,
122123
bool progress_needed);
124+
#endif
123125

124126
/* Returns 1 if optimized, 0 if not optimized, and -1 for an error.
125127
* If optimized, *executor_ptr contains a new reference to the executor
@@ -1526,6 +1528,7 @@ stack_allocate(_PyUOpInstruction *buffer, _PyUOpInstruction *output, int length)
15261528
return (int)(write - output);
15271529
}
15281530

1531+
#ifndef Py_GIL_DISABLED
15291532
static int
15301533
uop_optimize(
15311534
_PyInterpreterFrame *frame,
@@ -1606,6 +1609,7 @@ uop_optimize(
16061609
*exec_ptr = executor;
16071610
return 1;
16081611
}
1612+
#endif
16091613

16101614

16111615
/*****************************************

0 commit comments

Comments
 (0)