tree: 1c80121aabae6b73b1afa2c52abd87244df213ff [path history] [tgz]
  1. src/
  2. .cargo-checksum.json
  3. Cargo.toml
  4. CHANGELOG.md
  5. LICENSE
  6. README.md
third_party/rust_crates/vendor/typed-arena/README.md

rust-typed-arena

Docs Status

The arena, a fast but limited type of allocator.

Arenas are a type of allocator that destroy the objects within, all at once, once the arena itself is destroyed. They do not support deallocation of individual objects while the arena itself is still alive. The benefit of an arena is very fast allocation; just a vector push.

This is an equivalent to arena::TypedArena distributed with rustc, but is available of Rust beta/stable.

It is probably slightly less efficient, but is simpler internally and uses much less unsafe code. It is based on a Vec<Vec<T>> instead of raw pointers and manual drops.

There is also a method into_vec() to recover ownership of allocated objects when the arena is no longer required, instead of destroying everything.