Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
tjjfvi committed May 28, 2024
1 parent fd20dae commit 4a589d7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion runtime/src/parallel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ impl<'h> Net<'h> {
(0 .. tids).map(move |tid| {
let heap_size = (heap.0.len() / tids) & !63; // round down to needed alignment
let heap_start = heap_size * tid;
let area = unsafe { mem::transmute(&heap.0[heap_start .. heap_start + heap_size]) };
let area = unsafe { mem::transmute::<&[Node], &Heap>(&heap.0[heap_start .. heap_start + heap_size]) };
let mut net = Net::new_with_root(area, root.clone());
net.next = next.saturating_sub(heap_start);
net.head = if tid == 0 { net.head } else { Addr::NULL };
Expand Down
4 changes: 2 additions & 2 deletions util/src/new_uninit_slice.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use alloc::alloc::alloc;
use core::{alloc::Layout, mem::MaybeUninit};
use core::{alloc::Layout, mem::MaybeUninit, slice};

use crate::prelude::*;

// TODO: use `Box::new_uninit_slice` once stabilized
// https://github.com/rust-lang/rust/issues/63291
pub fn new_uninit_slice<T>(len: usize) -> Box<[MaybeUninit<T>]> {
unsafe { Box::from_raw(core::slice::from_raw_parts_mut(alloc(Layout::array::<T>(len).unwrap()).cast(), len)) }
unsafe { Box::from_raw(slice::from_raw_parts_mut(alloc(Layout::array::<T>(len).unwrap()).cast(), len)) }
}

0 comments on commit 4a589d7

Please sign in to comment.