Use std::alloc::alloc

This commit is contained in:
Yota Toyama
2019-04-30 15:28:16 +00:00
parent ac9bb2ec16
commit 50097eb073
4 changed files with 8 additions and 8 deletions

View File

@@ -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()) };
}
}