farena-0.2.1 has been yanked.
farena
A file-backed arena allocator.
Write data to a temporary file, then read it back by location. The data stays on disk instead of in memory, so your process doesn't use extra RAM.
Use this when you need scratch space for bytes but can't afford to keep everything in memory.
Temp files are created in your system's temp directory (respects TMPDIR).
Make sure your temp directory is on real disk, not in memory. Check with:
The filesystem should not be tmpfs or ramfs.
Usage
use ;
// Write phase
let mut writer = new?;
let = writer.push?;
let = writer.push?;
let file = writer.finish?.unwrap;
// Read phase
let arena = new?;
let loc1 = new;
let loc2 = new;
assert_eq!;
assert_eq!;
Multiple files
let mut w1 = new?;
let = w1.push?;
let f1 = w1.finish?.unwrap;
let mut w2 = new?;
let = w2.push?;
let f2 = w2.finish?.unwrap;
let arena = new?;
let loc1 = new; // file index 0
let loc2 = new; // file index 1
Buffer reuse
let mut buf = Vecnew;
arena.get_into?; // appends to buf