Skip to content
Prev Previous commit
Next Next commit
Rename interpreter cleanup functions
Rename functions to be more descriptive of their actions.
  • Loading branch information
ashm-dev committed Oct 19, 2025
commit e6ff33e158b67741bd196ec122aa2af0f5cb21fc
10 changes: 5 additions & 5 deletions Python/pystate.c
Original file line number Diff line number Diff line change
Expand Up @@ -486,19 +486,19 @@ free_interpreter(PyInterpreterState *interp)
}

static void
_finalize_and_free_interpreter(PyInterpreterState *interp)
cleanup_and_free_interpreter(PyInterpreterState *interp)
{
_Py_qsbr_fini(interp);
_PyObject_FiniState(interp);
free_interpreter(interp);
}

static inline void
_interp_release_owner(PyInterpreterState *interp)
release_interp_owner(PyInterpreterState *interp)
{
Py_ssize_t prev = _Py_atomic_add_ssize(&interp->owners, -1);
if (prev == 1) {
_finalize_and_free_interpreter(interp);
cleanup_and_free_interpreter(interp);
}
}

Expand Down Expand Up @@ -975,7 +975,7 @@ PyInterpreterState_Delete(PyInterpreterState *interp)

interp->finalizing = 1;
Comment thread
ashm-dev marked this conversation as resolved.
Outdated

_interp_release_owner(interp);
release_interp_owner(interp);
}


Expand Down Expand Up @@ -1441,7 +1441,7 @@ free_threadstate(_PyThreadStateImpl *tstate)
PyMem_RawFree(tstate);
}

_interp_release_owner(interp);
release_interp_owner(interp);
}

static void
Expand Down