Expand description
A Sync + Send allocator wrapper around bumpalo using per-thread bump allocators.
§Examples
With bumpalo’s collections:
use bump_local::Bump;
let bump = Bump::new();
// Get the current thread's instance
let local = bump.local();
let mut vec = bumpalo::collections::Vec::new_in(local.as_inner());
vec.push(1);
vec.push(2);With stable Rust and allocator-api2 feature:
ⓘ
use allocator_api2::vec::Vec;
use bump_local::Bump;
let bump = Bump::new();
let mut vec = Vec::new_in(bump.clone());
vec.push(1);
vec.push(2);With nightly Rust and allocator_api feature:
ⓘ
#![feature(allocator_api)]
use bump_local::Bump;
let bump = Bump::new();
let mut vec = Vec::new_in(bump.clone());
vec.push(1);
vec.push(2);Structs§
- Bump
- A thread-safe bump allocator that provides
Sync + Sendsemantics. - Bump
Builder - Builder for configuring a
Bumpallocator. - Bump
Local - Per-thread wrapper around a
bumpalo::Bumpallocator. - Reset
Error - Reset is only allowed when single Bump reference exists