Crates.io | ruyi-slab |
lib.rs | ruyi-slab |
version | 0.1.1 |
source | src |
created_at | 2020-05-04 00:06:27.913686 |
updated_at | 2020-05-09 20:45:16.901155 |
description | An object based allocator |
homepage | https://github.com/ruyi-rs/slab |
repository | https://github.com/ruyi-rs/slab |
max_upload_size | |
id | 237265 |
size | 34,199 |
An object based allocator backed by a contiguous growable array of slots.
The slab allocator pre-allocates memory for objects of same type so that it reduces fragmentation caused by allocations and deallocations. When allocating memory for an object, it just finds a free (unused) slot, marks it as used, and returns the index of the slot for later access to the object. When freeing an object, it just adds the slot holding the object to the list of free (unused) slots after dropping the object.
To use ruyi-slab without the Rust standard library but with a memory allocator:
[dependencies]
ruyi-slab = { version = "0.1", default-features = false }
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.