4 releases

0.0.4 Oct 3, 2024
0.0.3 Oct 3, 2024
0.0.2 Sep 22, 2024
0.0.1 Sep 22, 2024

#842 in Algorithms

Download history 129/week @ 2024-09-16 203/week @ 2024-09-23 224/week @ 2024-09-30 34/week @ 2024-10-07 42/week @ 2024-10-14 47/week @ 2024-10-21 8/week @ 2024-10-28 13/week @ 2024-11-04

112 downloads per month
Used in 5 crates (2 directly)

MIT license

5KB
77 lines

freelist-rs

A simple and efficient free list implementation in Rust, designed for managing the allocation and recycling of numeric IDs. Free numbers are recycled as late as possible to ensure minimal reuse over time, based on a Last In, First Out (LIFO) policy.

Features

  • LIFO-based recycling: Ensures that recently freed IDs are reused last
  • Customizable ID type: Supports any type that implements Copy, PartialEq, Debug, and From

Installation

Add the following to your Cargo.toml file:

[dependencies]
freelist-rs = "^0.0.3"

License

This library is licensed under the MIT License. See LICENSE for details.

No runtime deps