From 8d1adbfd19bb8b7c79f4b76d081fc55042c31c35 Mon Sep 17 00:00:00 2001 From: gnzlbg Date: Fri, 27 Apr 2018 11:37:16 +0200 Subject: [PATCH] oom is no longer part of GlobalAlloc --- src/lib.rs | 7 ++++--- tests/malloctl.rs | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 62bc2ac..9b899a5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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}; diff --git a/tests/malloctl.rs b/tests/malloctl.rs index 8e38eee..38c21af 100644 --- a/tests/malloctl.rs +++ b/tests/malloctl.rs @@ -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); } }