[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87h64qe3dt.fsf@kernel.org>
Date: Wed, 19 Feb 2025 09:37:50 +0100
From: Andreas Hindborg <a.hindborg@...nel.org>
To: "Asahi Lina" <lina@...hilina.net>
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>, "Alice Ryhl" <aliceryhl@...gle.com>,
"Trevor Gross" <tmgross@...ch.edu>, "Jann Horn" <jannh@...gle.com>,
"Matthew Wilcox" <willy@...radead.org>, "Paolo Bonzini"
<pbonzini@...hat.com>, "Danilo Krummrich" <dakr@...nel.org>, "Wedson
Almeida Filho" <wedsonaf@...il.com>, "Valentin Obst"
<kernel@...entinobst.de>, "Andrew Morton" <akpm@...ux-foundation.org>,
<linux-mm@...ck.org>, <airlied@...hat.com>, "Abdiel Janulgue"
<abdiel.janulgue@...il.com>, <rust-for-linux@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <asahi@...ts.linux.dev>
Subject: Re: [PATCH 1/6] rust: types: Add Ownable/Owned types
"Asahi Lina" <lina@...hilina.net> writes:
> By analogy to AlwaysRefCounted and ARef, an Ownable type is a (typically
> C FFI) type that *may* be owned by Rust, but need not be. Unlike
> AlwaysRefCounted, this mechanism expects the reference to be unique
> within Rust, and does not allow cloning.
>
> Conceptually, this is similar to a KBox<T>, except that it delegates
> resource management to the T instead of using a generic allocator.
>
> Signed-off-by: Asahi Lina <lina@...hilina.net>
Over all looks good to me - I agree with the points already discussed.
Could you put it in a separate module and file? `kernel::types::ownable`
and then `pub use` in `types.rs`. `types.rs` is getting quite busy.
Best regards,
Andreas Hindborg
Powered by blists - more mailing lists