Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Heap types created by type specs don't handle GC #4193

Open
scoder opened this issue May 25, 2021 · 1 comment · May be fixed by #5889
Open

[BUG] Heap types created by type specs don't handle GC #4193

scoder opened this issue May 25, 2021 · 1 comment · May be fixed by #5889

Comments

@scoder
Copy link
Contributor

scoder commented May 25, 2021

As noted in #3611 (comment), heap types need to implement the GC protocol, tp_traverse and tp_clear. When the CYTHON_USE_TYPE_SPECS option is set, this applies to all extension types.

See https://bugs.python.org/issue42972

@scoder scoder added this to the 3.0 milestone May 25, 2021
@scoder scoder modified the milestones: 3.0, 3.0.x Jul 23, 2023
@da-woods
Copy link
Contributor

I'm going to do this once #5846 is merged. It's slightly simpler than I was giving it credit for - only tp_traverse needs to handle type(self) (not tp_clean) and I think Python does the right thing for classes that only need to handle type(self). The only complication is that it's version dependent.

@da-woods da-woods self-assigned this Nov 24, 2023
@da-woods da-woods linked a pull request Dec 2, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants