From d7a327b11cb91965b8f60a4cd9da6e40eedcb10c Mon Sep 17 00:00:00 2001 From: Brennan Kinney <5098581+polarathene@users.noreply.github.com> Date: Sun, 12 Jul 2026 17:45:09 +1200 Subject: [PATCH] chore: `c-scape` - Remove conditional for riscv64 in `malloc()` --- c-scape/src/malloc/mod.rs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/c-scape/src/malloc/mod.rs b/c-scape/src/malloc/mod.rs index fa45e65..d314fe6 100644 --- a/c-scape/src/malloc/mod.rs +++ b/c-scape/src/malloc/mod.rs @@ -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}; @@ -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::()); let layout = match layout {