Skip to content

[WIP] test_keep_alive: Show that keep_alive cycle escapes GC #2762

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

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

EricCousineau-TRI
Copy link
Collaborator

This is a PR to track progress for #2761

@YannickJadoul
Copy link
Collaborator

I haven't even taken a shallow look, so apologies if I completely missed something, but what about enabling the GC to look into C types, using https://docs.python.org/3/c-api/gcsupport.html ?

@EricCousineau-TRI
Copy link
Collaborator Author

Nice! I don't think it'll fit in the current keep_alive infrastructure as-is, but I believe it could fit in with some sort of indirection (simplest would be cycle-only keep-alive, better would be for any time)

@bmerry
Copy link
Contributor

bmerry commented Dec 31, 2020

I haven't even taken a shallow look, so apologies if I completely missed something, but what about enabling the GC to look into C types, using https://docs.python.org/3/c-api/gcsupport.html ?

I think that would be the only sensible way to do it.

@YannickJadoul
Copy link
Collaborator

Not sure how, but there's bound to be some kind of way of opting into this, similar to the current py::dynamic_attributes() (which is also translated into a flag set on the actual PyHeapObject, I believe).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants