This Rust module provides a memory allocation Arena for types that implement Copy.
```rust extern crate copy_arena;
use copy_arena::Arena;
let mut arena = Arena::new(); let mut allocator = arena.allocator();
let a: &mut i32 = allocator.alloc(5); let b: &mut f64 = allocator.allocdefault(); let c: &mut [u8] = allocator.allocslice(b"some text"); let b: &mut [usize] = allocator.allocslicefn(10, |idx| idx + 1); let e: &mut [u32] = allocator.allocslicedefault(10); ```
This differs from the (unstable) Arena in Rust's standard library in a couple of ways:
Copy
-able objects -- no destructors are
executed.