Right now we are hardcoding the allocator in src/lib.rs (e.g. extern crate ralloc). This prevents people from switching the allocator. We should leave that option open by using a default allocator instead.
The mechanism to do that is to create an allocator crate named "alloc_system" and ship that with the sysroot. Where "ship that with the sysroot" means people will have to add that crate to Xargo.toml
We have two options for the default allocator
ralloc. Redox's allocator. We have run into some panics / segfaults with it before.
naive_ralloc. Which always leaks but no panics / segfaults with it so far. This allocator is not thread safe but we don't have threads yet.
We don't have to do this right now and we can always change whatever we picked as the default allocator.
Right now we are hardcoding the allocator in
src/lib.rs
(e.g.extern crate ralloc
). This prevents people from switching the allocator. We should leave that option open by using a default allocator instead.The mechanism to do that is to create an allocator crate named "alloc_system" and ship that with the sysroot. Where "ship that with the sysroot" means people will have to add that crate to Xargo.toml
We have two options for the default allocator
ralloc. Redox's allocator. We have run into some panics / segfaults with it before.
naive_ralloc. Which always leaks but no panics / segfaults with it so far. This allocator is not thread safe but we don't have threads yet.
We don't have to do this right now and we can always change whatever we picked as the default allocator.
P.S. the "alloc_system" name can be changed.