mirror of
https://github.com/bdwgc/bdwgc-rust.git
synced 2026-05-29 18:08:56 -06:00
Use std::alloc::alloc
This commit is contained in:
@@ -3,7 +3,7 @@ extern crate coroutine;
|
||||
|
||||
use bdwgc_alloc::Allocator;
|
||||
use coroutine::asymmetric::Coroutine;
|
||||
use std::alloc::{GlobalAlloc, Layout};
|
||||
use std::alloc::Layout;
|
||||
|
||||
#[global_allocator]
|
||||
static GLOBAL_ALLOCATOR: Allocator = Allocator;
|
||||
@@ -18,7 +18,7 @@ fn main() {
|
||||
Allocator::enable_gc();
|
||||
|
||||
loop {
|
||||
unsafe { GLOBAL_ALLOCATOR.alloc(Layout::from_size_align(2 ^ 8, 8).unwrap()) };
|
||||
unsafe { std::alloc::alloc(Layout::from_size_align(2 ^ 8, 8).unwrap()) };
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
extern crate bdwgc_alloc;
|
||||
|
||||
use bdwgc_alloc::Allocator;
|
||||
use std::alloc::{GlobalAlloc, Layout};
|
||||
use std::alloc::Layout;
|
||||
|
||||
#[global_allocator]
|
||||
static GLOBAL_ALLOCATOR: Allocator = Allocator;
|
||||
@@ -14,7 +14,7 @@ fn main() {
|
||||
unsafe { Allocator::register_current_thread().unwrap() }
|
||||
|
||||
for _ in 0..100 {
|
||||
unsafe { GLOBAL_ALLOCATOR.alloc(Layout::from_size_align(2 ^ 8, 8).unwrap()) };
|
||||
unsafe { std::alloc::alloc(Layout::from_size_align(2 ^ 8, 8).unwrap()) };
|
||||
}
|
||||
|
||||
unsafe { Allocator::unregister_current_thread() }
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
extern crate bdwgc_alloc;
|
||||
|
||||
use bdwgc_alloc::Allocator;
|
||||
use std::alloc::{GlobalAlloc, Layout};
|
||||
use std::alloc::Layout;
|
||||
|
||||
#[global_allocator]
|
||||
static GLOBAL_ALLOCATOR: Allocator = Allocator;
|
||||
@@ -10,6 +10,6 @@ fn main() {
|
||||
unsafe { Allocator::initialize() }
|
||||
|
||||
loop {
|
||||
unsafe { GLOBAL_ALLOCATOR.alloc(Layout::from_size_align(2 ^ 8, 8).unwrap()) };
|
||||
unsafe { std::alloc::alloc(Layout::from_size_align(2 ^ 8, 8).unwrap()) };
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
extern crate bdwgc_alloc;
|
||||
|
||||
use bdwgc_alloc::Allocator;
|
||||
use std::alloc::{GlobalAlloc, Layout};
|
||||
use std::alloc::Layout;
|
||||
|
||||
#[global_allocator]
|
||||
static GLOBAL_ALLOCATOR: Allocator = Allocator;
|
||||
@@ -13,7 +13,7 @@ fn main() {
|
||||
unsafe { Allocator::register_current_thread().unwrap() }
|
||||
|
||||
loop {
|
||||
unsafe { GLOBAL_ALLOCATOR.alloc(Layout::from_size_align(2 ^ 8, 8).unwrap()) };
|
||||
unsafe { std::alloc::alloc(Layout::from_size_align(2 ^ 8, 8).unwrap()) };
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user