oom is no longer part of GlobalAlloc

This commit is contained in:
gnzlbg 2018-04-27 11:37:16 +02:00
parent 00333ed768
commit 8d1adbfd19
2 changed files with 5 additions and 4 deletions

View File

@ -22,9 +22,10 @@
extern crate jemalloc_sys; extern crate jemalloc_sys;
extern crate libc; extern crate libc;
use core::mem; use std::mem;
use core::ptr::{self, NonNull}; use std::ptr::{self, NonNull};
use core::heap::{GlobalAlloc, Alloc, Layout, Opaque, Excess, CannotReallocInPlace, AllocErr}; use std::heap::{GlobalAlloc, Alloc, Layout, Opaque, Excess,
CannotReallocInPlace, AllocErr};
use libc::{c_int, c_void}; use libc::{c_int, c_void};

View File

@ -13,7 +13,7 @@ static A: Jemalloc = Jemalloc;
fn smoke() { fn smoke() {
let layout = Layout::from_size_align(100, 8).unwrap(); let layout = Layout::from_size_align(100, 8).unwrap();
unsafe { unsafe {
let ptr = Jemalloc.alloc(layout.clone()).unwrap_or_else(|_| panic!()); let ptr = Jemalloc.alloc(layout.clone()).unwrap();
Jemalloc.dealloc(ptr, layout); Jemalloc.dealloc(ptr, layout);
} }
} }