cactusref 0.3.0

Cycle-aware reference counting smart pointer
Documentation
#![warn(clippy::all)]
#![warn(clippy::pedantic)]

use cactusref::{Adopt, Rc};

#[test]
fn leak_mutually_adopted() {
    env_logger::Builder::from_env("CACTUS_LOG").init();

    log::info!("mutually adopted");

    let s = "a".repeat(1024 * 1024);

    let first = Rc::new(s.clone());
    let last = Rc::new(s);
    unsafe {
        Rc::adopt_unchecked(&first, &last);
        Rc::adopt_unchecked(&last, &first);
    }
    drop(first);
    drop(last);
}