项目作者: ruyi-rs

项目描述 :
An object based allocator.
高级语言: Rust
项目地址: git://github.com/ruyi-rs/slab.git
创建时间: 2020-05-03T23:23:30Z
项目社区:https://github.com/ruyi-rs/slab

开源协议:Other

下载


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:

  1. [dependencies]
  2. 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.