simple-slab
simple-slab is a simple slab-allocator in Rust. It aims to be as minimal and fast as possible.
Documentation
Usage
extern crate simple_slab;
use simple_slab::Slab;
fn main() {
const MAX_ELEMS: usize = 100000;
let mut slab = Slab::<u32>::new(MAX_ELEMS);
for num in 0..MAX_ELEMS {
slab.insert(num);
}
for offset in 0..slab.len() {
match slab[offset] {
Some(num) => {
}
None => {
}
}
}
for num in slab.iter() {
}
for offset in 0..slab.len() {
let num = slab.remove(offset).unwrap();
}
}
Author
Nathan Sizemore, nathanrsizemore@gmail.com
License
simple-slab is available under the MPL-2.0 license. See the LICENSE file for more info.