Skip to content

Commit c03bf0f

Browse files
committed
Fix build break
1 parent 97024a8 commit c03bf0f

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

framework/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ toml = "*"
2626
# Hack for SHM
2727
uuid= { version = "*", features=["v4"] }
2828
error-chain = "*"
29-
etcdv3-rs={ git="https://github.com/apanda/etcdv3-rs" }
3029
tokio-core=">=0.1.8"
3130
futures=">=0.1.14"
3231

framework/src/allocators/cache_aligned.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
use alloc::heap::{Alloc, Heap, Layout};
1+
use std::alloc::{self, Alloc, Global, Layout, Opaque};
22
use std::fmt;
33
use std::mem::size_of;
44
use std::ops::{Deref, DerefMut};
5-
use std::ptr::{self, Unique};
5+
use std::ptr::{self, Unique, NonNull};
66

77
const CACHE_LINE_SIZE: usize = 64;
88
unsafe fn allocate_cache_line(size: usize) -> *mut u8 {
9-
Heap.alloc_zeroed(Layout::from_size_align(size, CACHE_LINE_SIZE).unwrap())
10-
.unwrap()
9+
alloc::Global.alloc_zeroed(Layout::from_size_align(size, CACHE_LINE_SIZE).unwrap())
10+
.unwrap().as_ptr() as *mut u8
1111
}
1212

1313
pub struct CacheAligned<T: Sized> {
@@ -17,8 +17,8 @@ pub struct CacheAligned<T: Sized> {
1717
impl<T: Sized> Drop for CacheAligned<T> {
1818
fn drop(&mut self) {
1919
unsafe {
20-
Heap.dealloc(
21-
self.ptr.as_ptr() as *mut u8,
20+
alloc::Global.dealloc(
21+
NonNull::<Opaque>::new_unchecked(self.ptr.as_ptr() as *mut Opaque),
2222
Layout::from_size_align(size_of::<T>(), CACHE_LINE_SIZE).unwrap(),
2323
);
2424
}

0 commit comments

Comments
 (0)