Skip to content

Commit

Permalink
fixup! Fix allocator
Browse files Browse the repository at this point in the history
  • Loading branch information
apanda committed Jan 21, 2019
1 parent 998d456 commit 71dfb94
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions framework/src/allocators/cache_aligned.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::alloc::{self, Alloc, Global, Layout, Opaque};
use std::alloc::{self, Alloc, Global, Layout};
use std::fmt;
use std::mem::size_of;
use std::ops::{Deref, DerefMut};
Expand All @@ -18,7 +18,7 @@ impl<T: Sized> Drop for CacheAligned<T> {
fn drop(&mut self) {
unsafe {
alloc::Global.dealloc(
NonNull::<Opaque>::new_unchecked(self.ptr.as_ptr() as *mut Opaque),
NonNull::<u8>::new_unchecked(self.ptr.as_ptr() as *mut u8),
Layout::from_size_align(size_of::<T>(), CACHE_LINE_SIZE).unwrap(),
);
}
Expand Down

0 comments on commit 71dfb94

Please sign in to comment.