[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <DAISXMX28GH1.28P041TUGVRSR@kernel.org>
Date: Tue, 10 Jun 2025 13:04:00 +0200
From: "Benno Lossin" <lossin@...nel.org>
To: "Alice Ryhl" <aliceryhl@...gle.com>, "Danilo Krummrich"
<dakr@...nel.org>, "Miguel Ojeda" <ojeda@...nel.org>
Cc: <rust-for-linux@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] rust: vec: impl Default for Vec with any allocator
On Tue Jun 10, 2025 at 12:31 PM CEST, Alice Ryhl wrote:
> The implementation of Default is restricted to only work with kmalloc
> vectors for no good reason. This means I have to use
>
> mem::replace(&mut my_vec, KVVec::new())
>
> in Rust Binder instead of `mem::take(&mut my_vec)`. Thus, expand the
> impl of Default to work with any allocator including kvmalloc.
>
> Signed-off-by: Alice Ryhl <aliceryhl@...gle.com>
Reviewed-by: Benno Lossin <lossin@...nel.org>
---
Cheers,
Benno
> ---
> rust/kernel/alloc/kvec.rs | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Powered by blists - more mailing lists