This commit is contained in:
Yota Toyama
2023-09-28 12:51:38 +10:00
committed by GitHub
parent 7f2429fe25
commit 1e54b65b9e
12 changed files with 42 additions and 17 deletions

View File

@@ -2,7 +2,7 @@
name = "dynamic_threads"
version = "0.1.0"
authors = ["Yota Toyama <raviqqe@gmail.com>"]
edition = "2018"
edition = "2021"
publish = false
[dependencies]

View File

@@ -1,5 +1,3 @@
extern crate bdwgc_alloc;
use bdwgc_alloc::Allocator;
use std::alloc::Layout;
@@ -14,7 +12,7 @@ fn main() {
unsafe { Allocator::register_current_thread().unwrap() }
for _ in 0..100 {
unsafe { std::alloc::alloc(Layout::from_size_align(2 ^ 8, 8).unwrap()) };
let _ = unsafe { std::alloc::alloc(Layout::from_size_align(2 ^ 8, 8).unwrap()) };
}
unsafe { Allocator::unregister_current_thread() }