oom is no longer part of GlobalAlloc
This commit is contained in:
parent
00333ed768
commit
8d1adbfd19
|
@ -22,9 +22,10 @@
|
|||
extern crate jemalloc_sys;
|
||||
extern crate libc;
|
||||
|
||||
use core::mem;
|
||||
use core::ptr::{self, NonNull};
|
||||
use core::heap::{GlobalAlloc, Alloc, Layout, Opaque, Excess, CannotReallocInPlace, AllocErr};
|
||||
use std::mem;
|
||||
use std::ptr::{self, NonNull};
|
||||
use std::heap::{GlobalAlloc, Alloc, Layout, Opaque, Excess,
|
||||
CannotReallocInPlace, AllocErr};
|
||||
|
||||
use libc::{c_int, c_void};
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ static A: Jemalloc = Jemalloc;
|
|||
fn smoke() {
|
||||
let layout = Layout::from_size_align(100, 8).unwrap();
|
||||
unsafe {
|
||||
let ptr = Jemalloc.alloc(layout.clone()).unwrap_or_else(|_| panic!());
|
||||
let ptr = Jemalloc.alloc(layout.clone()).unwrap();
|
||||
Jemalloc.dealloc(ptr, layout);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue