Re: [PATCH v9 1/6] rust: kernel: add `drop_contents` to `BoxExt`
From: Miguel Ojeda
Date: Fri Aug 16 2024 - 17:11:46 EST
On Fri, Aug 16, 2024 at 10:48 PM Matt Gilbride <mattgilbride@xxxxxxxxxx> wrote:
>
> From: Benno Lossin <benno.lossin@xxxxxxxxx>
>
> Sometimes (see [1]) it is necessary to drop the value inside of a
> `Box<T>`, but retain the allocation. For example to reuse the allocation
> in the future.
> Introduce a new function `drop_contents` that turns a `Box<T>` into
> `Box<MaybeUninit<T>>` by dropping the value.
>
> Signed-off-by: Benno Lossin <benno.lossin@xxxxxxxxx>
> Link: https://lore.kernel.org/rust-for-linux/20240418-b4-rbtree-v3-5-323e134390ce@xxxxxxxxxx/ [1]
> Reviewed-by: Boqun Feng <boqun.feng@xxxxxxxxx>
> Reviewed-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
When sending a patch from someone else, then your own Signed-off-by is
still needed at the bottom.
By the way, since you are editing `helpers.c` later in the series, if
you don't mind rebasing on top of the helpers split [1], that would be
great (I am putting that one into rust-next very soon, in case it
helps):
https://lore.kernel.org/rust-for-linux/20240815103016.2771842-1-nmi@xxxxxxxxxxxx/
Thanks!
Cheers,
Miguel