mirror of
https://github.com/bdwgc/bdwgc-rust.git
synced 2026-10-28 10:23:17 -06:00
Change an example's name
This commit is contained in:
1 parent
8f96257594
commit
dc860f963c
3 files changed
+8
-8
No files matched your search
@@ -0,0 +1,17 @@
|
||||
extern crate bdwgc_alloc;
|
||||
|
||||
use bdwgc_alloc::Allocator;
|
||||
use std::alloc::{GlobalAlloc, Layout};
|
||||
|
||||
#[global_allocator]
|
||||
static GLOBAL_ALLOCATOR: Allocator = Allocator;
|
||||
|
||||
fn main() {
|
||||
unsafe { Allocator::initialize() }
|
||||
|
||||
let mut _n = unsafe { GLOBAL_ALLOCATOR.alloc(Layout::from_size_align(2 ^ 8, 8).unwrap()) };
|
||||
|
||||
loop {
|
||||
_n = unsafe { GLOBAL_ALLOCATOR.alloc(Layout::from_size_align(2 ^ 8, 8).unwrap()) };
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user