#unique-identifier #container #methods #different #allocating #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

#4 in #allocating

Download history 1269/week @ 2024-11-29 1418/week @ 2024-12-06 1197/week @ 2024-12-13 897/week @ 2024-12-20 226/week @ 2024-12-27 1356/week @ 2025-01-03 1475/week @ 2025-01-10 1094/week @ 2025-01-17 343/week @ 2025-01-24 1232/week @ 2025-01-31 1740/week @ 2025-02-07 1453/week @ 2025-02-14 1239/week @ 2025-02-21 1428/week @ 2025-02-28 1438/week @ 2025-03-07 1479/week @ 2025-03-14

5,881 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