Uh oh!
There was an error while loading. Please reload this page.
Refactor and improve: Arena, TypedArena - #27807
Conversation
rust-highfive
commented
Aug 13, 2015
r? @huonw (rust_highfive has picked a reviewer for you, use r? to override) |
huonw
commented
Aug 13, 2015
cc @gankro particularly for the RawVec changes. |
There was a problem hiding this comment.
I think this possibly needs to be RawVec<UnsafeCell<u8>> since there's effectively a transmute from &Chunk -> &mut [u8] in the various allocation methods; however I'm not totally sure it's needed because the Arena ensures non-aliased-ness of everything it hands out.
There was a problem hiding this comment.
I think UnsafeCell can be left out as long as we only use non-aliased or raw pointers. UnsafeCell's docs say:
In general, transmuting an
&Ttype into an&mut Tis considered undefined behavior.
huonw
commented
Aug 13, 2015
I idly wonder if this will slow the typedarena down noticably: it is adding an extra allocation (the That said I imagine it's not noticable. |
ef5f6e9 to
8a08f17Comparebors
commented
Sep 8, 2015
☔ The latest upstream changes (presumably #28287) made this pull request unmergeable. Please resolve the merge conflicts. |
Gankra
commented
Sep 8, 2015
\o/ for RawVec helping out even more! All the RawVec-internal stuff seems good, but I don't have the bandwidth to review the Arena stuff, sadly :( |
pczarn
commented
Sep 8, 2015
Thanks. Changes are pushed. |
bors
commented
Sep 11, 2015
☔ The latest upstream changes (presumably #28306) made this pull request unmergeable. Please resolve the merge conflicts. |
97a168b to
afa449cComparebors
commented
Sep 25, 2015
☔ The latest upstream changes (presumably #28610) made this pull request unmergeable. Please resolve the merge conflicts. |
afa449c to
92df7ffComparebors
commented
Oct 14, 2015
☔ The latest upstream changes (presumably #29026) made this pull request unmergeable. Please resolve the merge conflicts. |
pczarn
commented
Oct 26, 2015
Updated |
Gankra
commented
Oct 26, 2015
|
pczarn
commented
Nov 18, 2015
Corrected |
bors
commented
Nov 25, 2015
☔ The latest upstream changes (presumably #30017) made this pull request unmergeable. Please resolve the merge conflicts. |
shepmaster
commented
Jan 6, 2016
@pczarn great, I appreciate that! Although I'm totally cool with it having well-tested unsafe code ;-) I could always do some head-to-head perf testing between the two implementations to see if it's useful. |
pczarn
commented
Jan 6, 2016
@bluss: It's deprecated. |
aturon
commented
Jan 6, 2016
Nominating for libs team discussion re: deprecation. |
aturon
commented
Jan 8, 2016
Libs team consensus: the deprecation here isn't really relevant, as the crate is already gated by |
bluss
commented
Jan 8, 2016
bors
commented
Jan 8, 2016
📌 Commit e2ccc4f has been approved by |
bors
commented
Jan 8, 2016
⌛ Testing commit e2ccc4f with merge 927d22d... |
bors
commented
Jan 8, 2016
💔 Test failed - auto-linux-64-nopt-t |
bluss
commented
Jan 10, 2016
@bors retry |
bors
commented
Jan 11, 2016
⌛ Testing commit e2ccc4f with merge d3e5b72... |
bors
commented
Jan 11, 2016
💔 Test failed - auto-mac-64-opt |
alexcrichton
commented
Jan 11, 2016
@bors: retry On Mon, Jan 11, 2016 at 3:07 PM, bors notifications@github.com wrote:
|
bors
commented
Jan 11, 2016
⌛ Testing commit e2ccc4f with merge 02dc12b... |
bors
commented
Jan 11, 2016
💔 Test failed - auto-linux-64-nopt-t |
alexcrichton
commented
Jan 11, 2016
@bors: retry On Mon, Jan 11, 2016 at 7:41 PM, bors notifications@github.com wrote:
|
bors
commented
Jan 11, 2016
Fixes#18037 "TypedArena cannot handle zero-sized types". Closes#17931 "improve chunk allocation scheme used by Arena / TypedArena". Closes#22847 "TypedArena should implement Send". - N.B. Arena cannot implement Send, since it may contain non-Send values. Closes#18471 "`Arena::alloc_copy_inner` (at least) should be renamed and made public." - Added `Arena::alloc_bytes`. Closes#18261 "support clearing TypedArena with the chunks preserved". - Only the largest chunk is preserved.
bors
commented
Jan 11, 2016
There was a problem hiding this comment.
This comment should be removed, right?
Gankra
commented
Jan 12, 2016
🎊 Thanks so much for persevering on this, @pczarn! |
| #[unstable(feature = "rustc_private", | ||
| reason = "Private to rustc", issue = "0")] | ||
| #[rustc_deprecated(since = "1.6.0-dev", reason = | ||
| "The reflection-based arena is superseded by the any-arena crate")] |
There was a problem hiding this comment.
@jethrogb I published it now: https://crates.io/crates/any-arena
Fixes#18037 "TypedArena cannot handle zero-sized types".
Closes#17931 "improve chunk allocation scheme used by Arena / TypedArena".
Closes#22847 "TypedArena should implement Send". - N.B. Arena cannot implement Send, since it may contain non-Send values.
Closes#18471 "
Arena::alloc_copy_inner(at least) should be renamed and made public." - AddedArena::alloc_bytes.Closes#18261 "support clearing TypedArena with the chunks preserved". - Only the largest chunk is preserved.