mirror of
https://github.com/bdwgc/bdwgc-rust.git
synced 2026-05-29 18:08:56 -06:00
Remove tagged pointer example
This commit is contained in:
@@ -5,5 +5,4 @@ members = [
|
|||||||
"free_by_borrow",
|
"free_by_borrow",
|
||||||
"free_by_gc",
|
"free_by_gc",
|
||||||
"static_threads",
|
"static_threads",
|
||||||
"tagged_pointer",
|
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
[package]
|
|
||||||
name = "tagged_pointer"
|
|
||||||
version = "0.1.0"
|
|
||||||
authors = ["Yota Toyama <raviqqe@gmail.com>"]
|
|
||||||
edition = "2021"
|
|
||||||
publish = false
|
|
||||||
|
|
||||||
[dependencies]
|
|
||||||
bdwgc-alloc = { path = "../.." }
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
extern crate bdwgc_alloc;
|
|
||||||
|
|
||||||
use bdwgc_alloc::Allocator;
|
|
||||||
use std::alloc::Layout;
|
|
||||||
|
|
||||||
#[global_allocator]
|
|
||||||
static GLOBAL_ALLOCATOR: Allocator = Allocator;
|
|
||||||
|
|
||||||
fn main() {
|
|
||||||
unsafe { Allocator::initialize() }
|
|
||||||
|
|
||||||
let handle = std::thread::spawn(move || {
|
|
||||||
unsafe { Allocator::register_current_thread().unwrap() }
|
|
||||||
|
|
||||||
loop {
|
|
||||||
let _ = unsafe { std::alloc::alloc(Layout::from_size_align(2 ^ 8, 8).unwrap()) };
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
handle.join().unwrap();
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user