Re: [PATCH] rust: alloc: satisfy `aligned_alloc` requirements
From: Tamir Duberstein
Date: Sat Feb 01 2025 - 16:20:39 EST
Hi Danilo, thanks for the review!
On Sat, Feb 1, 2025 at 3:18 PM Danilo Krummrich <dakr@xxxxxxxxxx> wrote:
>
> I think I prefer this to be slightly more compact:
>
> let min_align = core::mem::size_of::<*const crate::ffi::c_void>();
> let (align, size) = if layout.align() < min_align {
> (min_align, layout.size().div_ceil(min_align) * min_align)
> } else {
> (layout.align(), layout.size())
> };
I was trying to avoid repeated calls to either function, but I'm happy
to shorten the variable names. Would that suit?