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

BST: remove some of the remaining pointers, earlier boxed code destruction #1384

Merged
merged 6 commits into from
Oct 19, 2016

Conversation

undingen
Copy link
Contributor

@undingen undingen commented Oct 8, 2016

This is a prerequisite for #1381 and removes the InternedString fields and pointers to BoxedCode. The code objects are now all currently refcounted which means we will free them when the are unused.

we don't need it anymore now that we eliminated nearly all pointers to nodes.
now that the FlattenVisitor is gone nobody uses this anymore
…ointer

Replace it with a index into a table of definitions and code objects

This also now frees much more code objects early because they get proper refcounted now
…able

In the future we should just support embedding tuples as constants (of course only when all elements are constant)
and then use this mechanism instead of the 'std::vector<BoxedString*>'
@undingen undingen mentioned this pull request Oct 8, 2016
@kmod
Copy link
Collaborator

kmod commented Oct 19, 2016

Not critical for this PR, but re the "remove pointer to FunctionDef and ClassDef" commit, I think we can clean that up -- we should be able to use the same constants strategy for the BoxedCode objects that we do for the other objects. And I think at this point we shouldn't need the parent BST node to keep a reference to the child BST node? I haven't verified that but it seems like all of the relevant information should already be included in the code object.

I'd also like to see us kill InternedString rather than keep cludging it. I think your unsafe() function already makes use of the fact that InternedString == BoxedString, and I think the better way to use that fact is to just get rid of InternedString :P

Anyway, these are just cleanups, which we can do at any time.

@kmod kmod merged commit 00bb5d2 into pyston:master Oct 19, 2016
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.

2 participants