summaryrefslogtreecommitdiff
path: root/Objects/object.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-06-10 20:08:26 +0200
committerGitHub <noreply@github.com>2020-06-10 20:08:26 +0200
commit1bcc32f0620d2e99649a6d423284d9496b7b3548 (patch)
treef42552bb9acbb5d9fd90b47f95a63487ab438262 /Objects/object.c
parent9c24e2e4c10705d95258558348417a28007dac66 (diff)
downloadcpython-git-1bcc32f0620d2e99649a6d423284d9496b7b3548.tar.gz
bpo-39465: Use _PyInterpreterState_GET() (GH-20788)
Replace _PyThreadState_GET() with _PyInterpreterState_GET() in: * get_small_int() * gcmodule.c: add also get_gc_state() function * _PyTrash_deposit_object() * _PyTrash_destroy_chain() * warnings_get_state() * Py_GetRecursionLimit() Cleanup listnode.c: add 'parser' variable.
Diffstat (limited to 'Objects/object.c')
-rw-r--r--Objects/object.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Objects/object.c b/Objects/object.c
index 10cbd1b7c1..0ab5de2849 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -2029,8 +2029,8 @@ finally:
void
_PyTrash_deposit_object(PyObject *op)
{
- PyThreadState *tstate = _PyThreadState_GET();
- struct _gc_runtime_state *gcstate = &tstate->interp->gc;
+ PyInterpreterState *interp = _PyInterpreterState_GET();
+ struct _gc_runtime_state *gcstate = &interp->gc;
_PyObject_ASSERT(op, _PyObject_IS_GC(op));
_PyObject_ASSERT(op, !_PyObject_GC_IS_TRACKED(op));
@@ -2057,8 +2057,8 @@ _PyTrash_thread_deposit_object(PyObject *op)
void
_PyTrash_destroy_chain(void)
{
- PyThreadState *tstate = _PyThreadState_GET();
- struct _gc_runtime_state *gcstate = &tstate->interp->gc;
+ PyInterpreterState *interp = _PyInterpreterState_GET();
+ struct _gc_runtime_state *gcstate = &interp->gc;
while (gcstate->trash_delete_later) {
PyObject *op = gcstate->trash_delete_later;