allocators-rs icon indicating copy to clipboard operation
allocators-rs copied to clipboard

slab-alloc: Support no-std and no-os

Open joshlf opened this issue 8 years ago • 3 comments

slab-alloc currently has an os feature and a std feature (which depends on the os feature). However, the code as it stands today can't actually compile without both features being enabled (which is the default). This issue tracks progress towards making slab-alloc truly support a no-std or no-os environment.

Tasks:

  • [ ] Create a mechanism for abstracting over time. Currently, in util::workingset, we use std::time::Instant to keep track of time. Instead, we need some mechanism (probably a trait) for keeping track of time that is agnostic to implementation. (#3)
  • [ ] Once a mechanism for abstracting over time exists, we should make it so that the user can supply it. In an os environment, we can implement this ourselves, but in a no-os environment, we have no way of knowing how time is represented or how to get the current time, so it must be provided by the user. (#3)
  • [ ] Support custom allocators for the pointer hashmap (ptr_map module). Currently, it relies on Vec and Box. Eventually, it should either drop these dependencies (and be implemented in terms of raw chunks of memory and raw pointers) or be upgraded once Vec and Box support parametric allocators. (#6)
  • [ ] Once we support custom allocators in ptr_map, we should make it so that the user can supply a custom allocator for this purpose. (#6)

joshlf avatar Aug 11 '17 21:08 joshlf

How far along is this?

lachlansneff avatar Nov 28 '17 04:11 lachlansneff

We've made no progress on this.

joshlf avatar Nov 28 '17 04:11 joshlf

However, @shivanth mentioned that they might work on #3. I don't know if that's happened.

joshlf avatar Nov 29 '17 18:11 joshlf