#unique-identifier #container #allocating #different #methods #allocate #id

idalloc

A library for different methods of allocating unique identifiers efficiently

2 releases

0.1.1 Feb 18, 2020
0.1.0 Feb 18, 2020

#1582 in Algorithms

Download history 2464/week @ 2024-03-14 2125/week @ 2024-03-21 2613/week @ 2024-03-28 2225/week @ 2024-04-04 3937/week @ 2024-04-11 4197/week @ 2024-04-18 3917/week @ 2024-04-25 2581/week @ 2024-05-02 2274/week @ 2024-05-09 3352/week @ 2024-05-16 3469/week @ 2024-05-23 3164/week @ 2024-05-30 2590/week @ 2024-06-06 3994/week @ 2024-06-13 3618/week @ 2024-06-20 2717/week @ 2024-06-27

13,432 downloads per month
Used in yuxii

MIT/Apache

9KB
102 lines

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);

lib.rs:

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);

No runtime deps