rodeo 0.1.1

Fast dropping arena based on bumpalo
Documentation
rodeo-0.1.1 has been yanked.

Rodeo

A dropping arena based on bumpalo.

Example

use rodeo::Rodeo;

let rodeo = Rodeo::new();

let _ref_n = rodeo.alloc(42);

struct S;
impl Drop for S {
    fn drop(&mut self) {
        println!("dropping S");
    }
}
let _ref = rodeo.alloc(S);

drop(rodeo);

prints dropping S

Features

  • bumpalo (default)

Safety

As a memory management library, this code uses unsafe extensively. However, the code is tested and dynamically verified.

Verification strategy

Tests

Some test scenarios are written with proptest.

Run the tests simply with:

$ cargo test

Miri

Miri is an interpreter for MIR (an intermediate representation of Rust) that checks Rust code and in particular unsafe code against the experimental Stacked Borrows memory model.

As of miri 0.1.0 (c1a859b 2022-11-10), Rodeo's tests emits no error or warning when run with Miri.

$ rustup +nightly component add miri # if needed
$ cargo +nightly miri test

To-Do

  • support custom finalizer (opt-in? through another type?)
  • add slice allocation (like Bump but dropping)

License

Rodeo is distributed under the terms of both the MIT license and the Apache License (Version 2.0). See LICENSE-MIT and LICENSE-APACHE.