|
|
|
|
|
by Arnavion
319 days ago
|
|
>But with the upcoming support for passing an allocator to any data structure (in the Rust standard library anyway) I think this gets a lot easier? Yes and no. Even within libstd, some things require A=GlobalAlloc, eg `std::io::Read::read_to_end(&mut Vec<u8>)` will only accept Vec<u8, GlobalAlloc>. It cannot be changed to work with Vec<u8, A> because that change would make it not dyn-compatible (nee "object-safe"). And as you said it will cut you off from much of the third-party crates ecosystem that also assumes A=GlobalAlloc. But if the subset of libstd you need supports A=!GlobalAlloc then yes it's helpful. |
|
Not sure if that is a breaking change though, it probably is because of a small detail, I'm not a rustc dev.