idalloc

A library for different methods of allocating unique identifiers efficiently.

APACHE-2.0 License

Downloads
121.4K
Stars
3

idalloc

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);
Package Rankings
Top 25.36% on Crates.io
Badges
Extracted from project README
Documentation Crates Actions Status