lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJ-ks9n3KfcSqocjXY6QojF6R_aGBiRsXBuyiX8Y0rHtjm3sNw@mail.gmail.com>
Date: Sat, 1 Feb 2025 16:19:48 -0500
From: Tamir Duberstein <tamird@...il.com>
To: Danilo Krummrich <dakr@...nel.org>
Cc: Miguel Ojeda <ojeda@...nel.org>, Alex Gaynor <alex.gaynor@...il.com>, 
	Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>, 
	Björn Roy Baron <bjorn3_gh@...tonmail.com>, 
	Benno Lossin <benno.lossin@...ton.me>, Andreas Hindborg <a.hindborg@...nel.org>, 
	Alice Ryhl <aliceryhl@...gle.com>, Trevor Gross <tmgross@...ch.edu>, rust-for-linux@...r.kernel.org, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] rust: alloc: satisfy `aligned_alloc` requirements

Hi Danilo, thanks for the review!

On Sat, Feb 1, 2025 at 3:18 PM Danilo Krummrich <dakr@...nel.org> 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?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ