Scoped-Arena provides arena-like allocator with optional scopes. Arena allocators are simple and provides ludicrously fast allocation.
Scope
allows storing values. When dropped Scope
will Drop
all stored values and free memory allocated by the scope.\
Well placed scopes can significantly reduce memory consumption.\
Creating new scope is cheap and allocating within scope is as fast as allocating parent arena allocator.\
Drop glue is stored in scope only for values that needs_drop
. i.e. for Copy
types storing value on scope is simply allocation + copy.
Rust borrowing rules require additional layer of ScopeProxy
to allow references to values on scope and sub-scopes to coexist.
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.