diff --git a/examples/borrow_check_free/Cargo.lock b/examples/borrow_check_free/Cargo.lock new file mode 100644 index 0000000..a8ebd57 --- /dev/null +++ b/examples/borrow_check_free/Cargo.lock @@ -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 = "borrow_check_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" diff --git a/examples/borrow_check_free/Cargo.toml b/examples/borrow_check_free/Cargo.toml new file mode 100644 index 0000000..e33c4e1 --- /dev/null +++ b/examples/borrow_check_free/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "borrow_check_free" +version = "0.1.0" +authors = ["Yota Toyama "] +edition = "2018" +publish = false + +[dependencies] +bdwgc-alloc = { path = "../.." } diff --git a/examples/borrow_check_free/src/main.rs b/examples/borrow_check_free/src/main.rs new file mode 100644 index 0000000..673df12 --- /dev/null +++ b/examples/borrow_check_free/src/main.rs @@ -0,0 +1,16 @@ +extern crate bdwgc_alloc; + +use bdwgc_alloc::Allocator; + +#[global_allocator] +static GLOBAL_ALLOCATOR: Allocator = Allocator; + +fn main() { + unsafe { Allocator::initialize() } + + let mut _n: Box<[u8; 2 ^ 8]> = Box::new([0; 2 ^ 8]); + + loop { + _n = Box::new([0; 2 ^ 8]); + } +}