Title: gh-94207: Fix struct module leak by mdickinson · Pull Request #94239 · python/cpython · GitHub
Open Graph Title: gh-94207: Fix struct module leak by mdickinson · Pull Request #94239 · python/cpython
X Title: gh-94207: Fix struct module leak by mdickinson · Pull Request #94239 · python/cpython
Description: Possible fix for the _struct module reference leak reported in #94207. What appears to be happening is that once the _struct cache is nonempty, there's a reference cycle from the module to the cache, to any Struct instance in the cache, to the Struct type, back to the module. Since Struct objects are not GC-tracked, that cycle is never collected. This PR makes _struct.Struct GC-tracked, and adds a regression test. Issue: gh-94207
Open Graph Description: Possible fix for the _struct module reference leak reported in #94207. What appears to be happening is that once the _struct cache is nonempty, there's a reference cycle from the module to the ...
X Description: Possible fix for the _struct module reference leak reported in #94207. What appears to be happening is that once the _struct cache is nonempty, there's a reference cycle from the module to ...
Opengraph URL: https://github.com/python/cpython/pull/94239
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:eb6a5ad9-9b21-f999-ddd9-1aebf2f19fac |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | AA58:247E0C:15907E7:1DC3434:696AA4EE |
| html-safe-nonce | 36357930309f6cb23b7b2b211e2b7ee624aa4544c9d39fc1fc0c45a734d3a44a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQTU4OjI0N0UwQzoxNTkwN0U3OjFEQzM0MzQ6Njk2QUE0RUUiLCJ2aXNpdG9yX2lkIjoiMjc0MTMxNTA5MjM1ODAxNDE5MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 82198c6fe4de0d679cc6182f79b83cdd2f0656a59eb2f9217bda64bd90653af5 |
| hovercard-subject-tag | pull_request:978605883 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/python/cpython/pull/94239/files |
| twitter:image | https://avatars.githubusercontent.com/u/662003?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/662003?s=400&v=4 |
| og:image:alt | Possible fix for the _struct module reference leak reported in #94207. What appears to be happening is that once the _struct cache is nonempty, there's a reference cycle from the module to the ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | a51f97dbb9326f71c08ecb61577457d543c602124d1a2672871258ef37ac5261 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4bd0eac606c70914085176ef312ebdcd97a8cdf1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width