Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions c-scape/src/malloc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
//! TODO: Use `alloc_zeroed` and `realloc` instead of doing the work
//! ourselves, which might let allocators be more efficient.

#[cfg(not(target_arch = "riscv64"))]
use core::mem::align_of;
use core::mem::size_of;
use core::ptr::{copy_nonoverlapping, null_mut, write_bytes};
Expand Down Expand Up @@ -107,10 +106,6 @@ unsafe extern "C" fn malloc(size: usize) -> *mut c_void {
// wild interprets NULL as an allocation failure.
let size = if size == 0 { size + 1 } else { size };

// TODO: Add `max_align_t` for riscv64 to upstream libc.
#[cfg(target_arch = "riscv64")]
let layout = alloc::alloc::Layout::from_size_align(size, 16);
#[cfg(not(target_arch = "riscv64"))]
let layout = alloc::alloc::Layout::from_size_align(size, align_of::<libc::max_align_t>());

let layout = match layout {
Expand Down
Loading