Skip to content

Commit

Permalink
Rename _Py_SetOptimizerAPI() to _Py_SetTier2Optimizer().
Browse files Browse the repository at this point in the history
  • Loading branch information
vstinner committed Jun 26, 2024
1 parent 3f73bf3 commit 1e8a1c0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Include/internal/pycore_optimizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ PyAPI_FUNC(void) _Py_Executor_DependsOn(_PyExecutorObject *executor, void *obj);
// For testing
// Export for '_testinternalcapi' shared extension.
PyAPI_FUNC(_PyOptimizerObject *) _Py_GetOptimizer(void);
PyAPI_FUNC(int) _Py_SetOptimizerAPI(_PyOptimizerObject* optimizer);
PyAPI_FUNC(int) _Py_SetTier2Optimizer(_PyOptimizerObject* optimizer);
PyAPI_FUNC(PyObject *) _PyOptimizer_NewCounter(void);
PyAPI_FUNC(PyObject *) _PyOptimizer_NewUOpOptimizer(void);

Expand Down
2 changes: 1 addition & 1 deletion Modules/_testinternalcapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,7 @@ set_optimizer(PyObject *self, PyObject *opt)
if (opt == Py_None) {
opt = NULL;
}
if (_Py_SetOptimizerAPI((_PyOptimizerObject*)opt) < 0) {
if (_Py_SetTier2Optimizer((_PyOptimizerObject*)opt) < 0) {
return NULL;
}
Py_RETURN_NONE;
Expand Down
2 changes: 1 addition & 1 deletion Python/optimizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ _Py_SetOptimizer(PyInterpreterState *interp, _PyOptimizerObject *optimizer)
}

int
_Py_SetOptimizerAPI(_PyOptimizerObject *optimizer)
_Py_SetTier2Optimizer(_PyOptimizerObject *optimizer)
{
PyInterpreterState *interp = _PyInterpreterState_GET();
_PyOptimizerObject *old = _Py_SetOptimizer(interp, optimizer);
Expand Down
2 changes: 1 addition & 1 deletion Python/pylifecycle.c
Original file line number Diff line number Diff line change
Expand Up @@ -1301,7 +1301,7 @@ init_interp_main(PyThreadState *tstate)
if (opt == NULL) {
return _PyStatus_ERR("can't initialize optimizer");
}
if (_Py_SetOptimizerAPI((_PyOptimizerObject *)opt)) {
if (_Py_SetTier2Optimizer((_PyOptimizerObject *)opt)) {
return _PyStatus_ERR("can't install optimizer");
}
Py_DECREF(opt);
Expand Down

0 comments on commit 1e8a1c0

Please sign in to comment.