Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*: make CI green again #146

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
use AllocRef
Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
  • Loading branch information
BusyJay committed Mar 10, 2020
commit 18ee69fcfb43b67696d910cdb7cbe87f37a21868
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ extern crate jemalloc_sys;
extern crate libc;

#[cfg(feature = "alloc_trait")]
use core::alloc::{Alloc, AllocErr, CannotReallocInPlace, Excess};
use core::alloc::{AllocRef, AllocErr, CannotReallocInPlace, Excess};
use core::alloc::{GlobalAlloc, Layout};
#[cfg(feature = "alloc_trait")]
use core::ptr::NonNull;
Expand Down Expand Up @@ -143,7 +143,7 @@ unsafe impl GlobalAlloc for Jemalloc {
}

#[cfg(feature = "alloc_trait")]
unsafe impl Alloc for Jemalloc {
unsafe impl AllocRef for Jemalloc {
#[inline]
unsafe fn alloc(&mut self, layout: Layout) -> Result<NonNull<u8>, AllocErr> {
NonNull::new(GlobalAlloc::alloc(self, layout)).ok_or(AllocErr)
Expand Down
2 changes: 1 addition & 1 deletion tests/grow_in_place.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ static A: Jemalloc = Jemalloc;
#[cfg(feature = "alloc_trait")]
fn shrink_in_place() {
unsafe {
use std::alloc::{Alloc, Layout};
use std::alloc::{AllocRef, Layout};

// allocate 7 bytes which end up in the 8 byte size-class as long as
// jemalloc's default size classes are used:
Expand Down
2 changes: 1 addition & 1 deletion tests/shrink_in_place.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ static A: Jemalloc = Jemalloc;
#[cfg(feature = "alloc_trait")]
fn shrink_in_place() {
unsafe {
use std::alloc::{Alloc, Layout};
use std::alloc::{AllocRef, Layout};

// allocate a "large" block of memory:
let orig_sz = 10 * 4096;
Expand Down