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/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:0f099f76-9406-1f51-a581-e887f4bc8727 |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | 82E8:4D95E:143D6AF:1C72F0E:696A3455 |
| html-safe-nonce | 58cd706c160e0a8191ea14da86539ee3e2d29fefc670ce3fad7c865149b266ed |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MkU4OjREOTVFOjE0M0Q2QUY6MUM3MkYwRTo2OTZBMzQ1NSIsInZpc2l0b3JfaWQiOiIyNDMzNzcyOTE5NzQ1ODE5NzMzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 6da6355f6b2525a37bf86201607f5ee91bf38e662fe5fa4d6fc4cff0abde74d0 |
| hovercard-subject-tag | pull_request:978605883 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,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/checks |
| 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 | 321736bfdb3f591415ae895a0459bec204b26a76caf47ba5c980634cfacc4538 |
| 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 full-width full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7a9163cefd1ea4bd06f8eb7c082f43e4e53f626f |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width