mirror of
https://github.com/python/cpython.git
synced 2025-08-23 10:16:01 +00:00
bpo-40268: Rename _PyInterpreterState_GET_UNSAFE() (GH-19509)
Rename _PyInterpreterState_GET_UNSAFE() to _PyInterpreterState_GET() for consistency with _PyThreadState_GET() and to have a shorter name (help to fit into 80 columns). Add also "assert(tstate != NULL);" to the function.
This commit is contained in:
parent
4a3fe08353
commit
81a7be3fa2
23 changed files with 53 additions and 52 deletions
|
@ -6,7 +6,7 @@
|
|||
#include "structmember.h"
|
||||
#include "pycore_code.h"
|
||||
#include "pycore_interp.h" // PyInterpreterState.co_extra_freefuncs
|
||||
#include "pycore_pystate.h" // _PyInterpreterState_GET_UNSAFE()
|
||||
#include "pycore_pystate.h" // _PyInterpreterState_GET()
|
||||
#include "pycore_tupleobject.h"
|
||||
#include "clinic/codeobject.c.h"
|
||||
|
||||
|
@ -555,7 +555,7 @@ code_dealloc(PyCodeObject *co)
|
|||
co->co_opcache_size = 0;
|
||||
|
||||
if (co->co_extra != NULL) {
|
||||
PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE();
|
||||
PyInterpreterState *interp = _PyInterpreterState_GET();
|
||||
_PyCodeObjectExtra *co_extra = co->co_extra;
|
||||
|
||||
for (Py_ssize_t i = 0; i < co_extra->ce_size; i++) {
|
||||
|
@ -1074,7 +1074,7 @@ _PyCode_GetExtra(PyObject *code, Py_ssize_t index, void **extra)
|
|||
int
|
||||
_PyCode_SetExtra(PyObject *code, Py_ssize_t index, void *extra)
|
||||
{
|
||||
PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE();
|
||||
PyInterpreterState *interp = _PyInterpreterState_GET();
|
||||
|
||||
if (!PyCode_Check(code) || index < 0 ||
|
||||
index >= interp->co_extra_user_count) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue