idalloc

Crates.ioidalloc
lib.rsidalloc
version0.1.1
sourcesrc
created_at2020-02-18 18:06:08.812746
updated_at2020-02-18 18:09:29.229066
descriptionA library for different methods of allocating unique identifiers efficiently.
homepagehttps://github.com/udoprog/idalloc
repositoryhttps://github.com/udoprog/idalloc
max_upload_size
id210384
size20,305
John-John Tedro (udoprog)

documentation

https://docs.rs/idalloc

README

idalloc

Documentation Crates Actions Status

A library for different methods of allocating unique identifiers efficiently.

Provided methods:

  • Slab - Allocates id in a slab-like manner, handling automatic reclamation by keeping a record of which identifier slot to allocate next.

Examples

let mut alloc = idalloc::Slab::<u32>::new();
assert_eq!(0u32, alloc.next());
assert_eq!(1u32, alloc.next());
alloc.free(0u32);
Commit count: 5

cargo fmt