Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Move _Py_RefTotal to PyInterpreterState #102304

Closed
Assignees
ericsnowcurrently
@ericsnowcurrently

Description

@ericsnowcurrently

(Seegh-100227.)

_Py_RefTotal holds the current global total number of refcounts. It only exists ifPy_REF_DEBUG is defined (implied byPy_DEBUG). It is exposed bysys.gettotalrefcount() and set byPy_INCREF(),Py_DECREF(), etc. and_Py_NewReference().

Modications to_Py_RefTotal are currently protected by the GIL so it should be moved toPyInterpreterState. For various aspects of compatibility, it makes sense to keep the_Py_RefTotal symbol around (and correct) and keep returning the global total fromsys.gettotalrefcount().

Also,_Py_RefTotal is used by stable ABI extensions only wherePy_REF_DEBUG is defined (unlikely) and only where built against 3.9 or earlier. Just in case, though, we must still keep the global variable around, so any solution here must respect that.

Linked PRs

Metadata

Metadata

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp