Skip to content
This repository has been archived by the owner on Dec 9, 2018. It is now read-only.

Pick a default allocator #114

Open
japaric opened this issue Feb 25, 2017 · 0 comments
Open

Pick a default allocator #114

japaric opened this issue Feb 25, 2017 · 0 comments

Comments

@japaric
Copy link
Owner

japaric commented Feb 25, 2017

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant