Title: Move _Py_RefTotal to PyInterpreterState · Issue #102304 · python/cpython · GitHub
Open Graph Title: Move _Py_RefTotal to PyInterpreterState · Issue #102304 · python/cpython
X Title: Move _Py_RefTotal to PyInterpreterState · Issue #102304 · python/cpython
Description: (See gh-100227.) _Py_RefTotal holds the current global total number of refcounts. It only exists if Py_REF_DEBUG is defined (implied by Py_DEBUG). It is exposed by sys.gettotalrefcount() and set by Py_INCREF(), Py_DECREF(), etc. and _Py_...
Open Graph Description: (See gh-100227.) _Py_RefTotal holds the current global total number of refcounts. It only exists if Py_REF_DEBUG is defined (implied by Py_DEBUG). It is exposed by sys.gettotalrefcount() and set by...
X Description: (See gh-100227.) _Py_RefTotal holds the current global total number of refcounts. It only exists if Py_REF_DEBUG is defined (implied by Py_DEBUG). It is exposed by sys.gettotalrefcount() and set by...
Opengraph URL: https://github.com/python/cpython/issues/102304
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Move _Py_RefTotal to PyInterpreterState","articleBody":"(See gh-100227.)\r\n\r\n`_Py_RefTotal` holds the current global total number of refcounts. It only exists if `Py_REF_DEBUG` is defined (implied by `Py_DEBUG`). It is exposed by `sys.gettotalrefcount()` and set by `Py_INCREF()`, `Py_DECREF()`, etc. and `_Py_NewReference()`.\r\n\r\nModications to `_Py_RefTotal` are currently protected by the GIL so it should be moved to `PyInterpreterState`. For various aspects of compatibility, it makes sense to keep the `_Py_RefTotal` symbol around (and correct) and keep returning the global total from `sys.gettotalrefcount()`.\r\n\r\nAlso, `_Py_RefTotal` is used by stable ABI extensions only where `Py_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.\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-102514\n* gh-102543\n* gh-102545\n* gh-102845\n* gh-102846\n* gh-104762\n* gh-104763\n* gh-104766\n* gh-105123\n* gh-105345\n* gh-105347\n* gh-105351\n* gh-105352\n* gh-105371\n* gh-105389\n* gh-105391\n* gh-105550\n* gh-105551\n* gh-105552\n* gh-105553\n* gh-107193\n* gh-107199\n* gh-109901\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/ericsnowcurrently","@type":"Person","name":"ericsnowcurrently"},"datePublished":"2023-02-27T17:33:02.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":18},"url":"https://github.com/102304/cpython/issues/102304"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7217b990-59e3-42bd-a134-bb428969c7b9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E69C:32375B:9003CC:C05CF9:6969BEAE |
| html-safe-nonce | 4fb8e68936767c56d270d243d8dfcf6b9394cf2178b6aa71db00dbe697d58a18 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNjlDOjMyMzc1Qjo5MDAzQ0M6QzA1Q0Y5OjY5NjlCRUFFIiwidmlzaXRvcl9pZCI6IjgzNjc0NTgyNTEzNjMxNzIwMTQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | c0a90e83cc5349b97c5037bea6276a1dd29a5d4e8ed98a69e87102cbd712fad4 |
| hovercard-subject-tag | issue:1601628572 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/102304/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0bf800a94b0782b8d9fd0e2968ca3ebaaf9b62447747ff2d6129c81bb12a9edc/python/cpython/issues/102304 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0bf800a94b0782b8d9fd0e2968ca3ebaaf9b62447747ff2d6129c81bb12a9edc/python/cpython/issues/102304 |
| og:image:alt | (See gh-100227.) _Py_RefTotal holds the current global total number of refcounts. It only exists if Py_REF_DEBUG is defined (implied by Py_DEBUG). It is exposed by sys.gettotalrefcount() and set by... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ericsnowcurrently |
| hostname | github.com |
| expected-hostname | github.com |
| None | acedec8b5f975d9e3d494ddd8f949b0b8a0de59d393901e26f73df9dcba80056 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 83c08c21cdda978090dc44364b71aa5bc6dcea79 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width