Change an example's name

This commit is contained in:
Yota Toyama
2019-04-15 15:43:07 +00:00
parent 8f96257594
commit dc860f963c
3 changed files with 8 additions and 8 deletions
+23
View File
@@ -0,0 +1,23 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
[[package]]
name = "bdwgc-alloc"
version = "0.2.0"
dependencies = [
"libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "gc_free"
version = "0.1.0"
dependencies = [
"bdwgc-alloc 0.2.0",
]
[[package]]
name = "libc"
version = "0.2.51"
source = "registry+https://github.com/rust-lang/crates.io-index"
[metadata]
"checksum libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)" = "bedcc7a809076656486ffe045abeeac163da1b558e963a31e29fbfbeba916917"
+9
View File
@@ -0,0 +1,9 @@
[package]
name = "gc_free"
version = "0.1.0"
authors = ["Yota Toyama <raviqqe@gmail.com>"]
edition = "2018"
publish = false
[dependencies]
bdwgc-alloc = { path = "../.." }
+17
View File
@@ -0,0 +1,17 @@
extern crate bdwgc_alloc;
use bdwgc_alloc::Allocator;
use std::alloc::{GlobalAlloc, Layout};
#[global_allocator]
static GLOBAL_ALLOCATOR: Allocator = Allocator;
fn main() {
unsafe { Allocator::initialize() }
let mut _n = unsafe { GLOBAL_ALLOCATOR.alloc(Layout::from_size_align(2 ^ 8, 8).unwrap()) };
loop {
_n = unsafe { GLOBAL_ALLOCATOR.alloc(Layout::from_size_align(2 ^ 8, 8).unwrap()) };
}
}