2 ms·
NB: that is sorta true right now (as the sentence says, "seems to"), but it's also an area of active work; we don't expect Rust to end up that way. To elaborat
by steveklabnik 9y ago
NB: that is sorta true right now (as the sentence says, "seems to"), but it's also an area of active work; we don't expect Rust to end up that way.
To elaborate a bit:
Right now, the standard library relies on an allocator. The language itself does not. If you want to write your own types and back them up by your own allocator, you can 100% do that today. But that doesn't help you with any of the stuff in the stdlib.
We have work on:
1. A trait for allocation, so that allocators can have the same APIs. https://github.com/rust-lang/rust/issues/32838 https://github.com/rust-lang/rust/issues/32838
2. Swapping out that allocator entirely, wholesale. Tor and Firefox both want this. https://github.com/rust-lang/rust/issues/27389 https://github.com/rust-lang/rust/issues/27389
3. Allowing you to swap out the allocator of stdlib types on a per-instance basis; this almost had an RFC for the needed machinery, but was postponed. Will probably come up again in the coming year after #1 & #2 get resolved.
- ngrilly 9y agoDuly noted ;-)