ruyi-slab

Crates.ioruyi-slab
lib.rsruyi-slab
version0.1.1
sourcesrc
created_at2020-05-04 00:06:27.913686
updated_at2020-05-09 20:45:16.901155
descriptionAn object based allocator
homepagehttps://github.com/ruyi-rs/slab
repositoryhttps://github.com/ruyi-rs/slab
max_upload_size
id237265
size34,199
Agemo Cui (agemocui)

documentation

https://docs.rs/ruyi-slab

README

Ruyi Slab

release license crates.io docs

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.

No-std Support

To use ruyi-slab without the Rust standard library but with a memory allocator:

[dependencies]
ruyi-slab = { version = "0.1", default-features = false }

License

Licensed under either of

at your option.

Contribution

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.

Commit count: 4

cargo fmt