Re:What is Rust and why is it so popular?
by steveklabnik on Tuesday January 21, 2020 @01:45PM
(#22110014)
Global allocator is a standard library concern, not a language concern, and Box is magic in only one tiny way that doesn’t actually have to do with allocation. Eventually that will be available to other libraries too.
Re:What is Rust and why is it so popular?
by shepmaster on Tuesday January 21, 2020 @01:22PM
(#22109743)
> If Rust supported "pluggable" allocators in some fashion
It's coming, but it's still unstable and being actively developed
Re:What is Rust and why is it so popular?
by Ar-Curunir on Tuesday January 21, 2020 @01:10PM
(#22109600)
`std` data structures that are generic over type of allocator are in the works.
AIUI, Rust knows more about allocations than it should, since it's still limited to a single global allocator, and Box<> (which relies on that global allocator) is implemented via compiler magic and cannot be supplemented by equivalent library code. If Rust supported "pluggable" allocators in some fashion, fancy features (including heap compaction, although I find that a bit dubious TBH) might become easier to implement.