cgc 0.4.0

Compacting garbage collector
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
extern crate cgc;
use cgc::heap::*;
use cgc::threads::*;

fn main() {
    simple_logger::init().unwrap();
    attach_current_thread();
    {
        let x = mt_alloc(42, false);
        let y = mt_alloc(3, false);
        println!("{}", *x + *y);
    }
    HEAP.collect();
    std::thread::sleep(std::time::Duration::from_nanos(200000));
}