Expand description
A growable, reusable box for Rust.
This crate provides a custom Box type with matching API that also allows to reuse the same
memory block to store different types with the minimal amount of allocations and is supposed to be
used with a pool-based allocator such as GrowablePool
.
§Notes
This crate uses a lot of ground-breaking features of Rust and therefore is only available on the latest Nightly build.
Structs§
- Growable
- A chunk of the heap memory that can be assigned with an arbitrary type.
- Growable
Pool - A pool of
Growable
objects. Unlike a typical Arena-based allocator it probably will not be able to decrease a memory fragmentation or provide some strong guarantees about frequency of allocations in your code but instead can be used to reduce the total amount of allocations in an amortized way by reusing the same memory to store different objects. - Growable
Pool Builder - A customizable
GrowablePool
builder. - Reusable
- A reusable box. It behaves just like the default
Box
(and it WILL free memory on drop) but it is also possible to free it manually, fetching aGrowable
back.
Functions§
- replace
- Replaces the value, dropping the old one but not the memory associated with it.