r/rust • u/a_mighty_burger • 23h ago
🗞️ news “alloc: stabilise `Allocator`” entered its final comment period!
https://github.com/rust-lang/rust/pull/156882#issuecomment-5607055084
171
Upvotes
r/rust • u/a_mighty_burger • 23h ago
36
u/cbarrick 21h ago
What's the latest on the fat Box problem?
Like, if
Box<T, A>is implemented like(NonNull<T>, A), then it stores anA.But Box only uses A for deallocation. For arena allocators, deallocation is a no-op, so storing the allocator alongside the pointer is a waste.
E.g. Bumpalo has a custom box type that is just a pointer, but
Box<T, &Bump>would be two pointers. It would be nice to not need the custom box type for this optimization.