Add examples directory

This commit is contained in:
Yota Toyama
2019-04-13 20:49:12 +00:00
parent 72b8768350
commit 1d5c505752
3 changed files with 48 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
extern crate bdwgc_allocator;
#[global_allocator]
static GLOBAL_ALLOCATOR: bdwgc_allocator::Allocator = bdwgc_allocator::Allocator;
fn main() {
unsafe {
bdwgc_allocator::Allocator::initialize();
bdwgc_allocator::Allocator::start_gc();
}
let mut _n = bdwgc_allocator::Allocator::alloc(2 ^ 8);
loop {
_n = bdwgc_allocator::Allocator::alloc(2 ^ 8)
}
}