-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Box Block, fn_decl, variant and Ty in the AST. #10676
Conversation
@@ -236,9 +236,8 @@ impl Ctx { | |||
visit::walk_stmt(self, stmt, ()); | |||
} | |||
|
|||
fn map_block(&mut self, b: &Block) { | |||
// clone is FIXME #2543 | |||
self.map.insert(b.id, node_block((*b).clone())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed this clone, but not others (the variant
one just below and some in the parser), any suggestions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oddly #2543 was closed by PR #9088 even though this comment remained in the source. I assume @nikomatsakis did mean to close it, since that PR removed a large number of the copies, but clearly not all of them...
Should this really use @ box instead of ~ box? |
I will try to implement a proper arena, instead of leaking, with safe-ish (always fail on ptr deref) post-drop behavior (maybe by |
Nevermind my previous idea, I'm using |
What improvements are those in particular? I would like to remove |
(Note that this is without -O) |
@pcwalton: AFAIK he just means the dereference operator overload |
@pcwalton custom (auto-)dereference, (auto-)borrow and (optionally) use-after-move handler - so explicit cloning to split ownership isn't required. |
For me, sha 468657c fails |
Rebased and updated rustdoc - my bad, I always forget to fix the tests. |
Squash and r=me |
… critical enum sizes.
**Note**: I only tested on top of my #10670 PR, size reductions come from both change sets. With this, [more enums are shrinked](https://gist.github.com/eddyb/08fef0dfc6ff54e890bc), the most significant one being `ast_node`, from 104 bytes (master) to 96 (#10670) and now to 32 bytes. My own testcase requires **200MB** less when compiling (not including the other **200MB** gained in #10670), and rustc-stage2 is down by about **130MB**. I believe there is more to gain by fiddling with the enums' layouts.
Note: I only tested on top of my #10670 PR, size reductions come from both change sets.
With this, more enums are shrinked, the most significant one being
ast_node
, from 104 bytes (master) to 96 (#10670) and now to 32 bytes.My own testcase requires 200MB less when compiling (not including the other 200MB gained in #10670), and rustc-stage2 is down by about 130MB.
I believe there is more to gain by fiddling with the enums' layouts.