From: Boqun Feng <boqun.feng@gmail.com>
To: Alice Ryhl <aliceryhl@google.com>
Cc: "Miguel Ojeda" <ojeda@kernel.org>,
"Alex Gaynor" <alex.gaynor@gmail.com>,
"Wedson Almeida Filho" <wedsonaf@gmail.com>,
"Gary Guo" <gary@garyguo.net>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Benno Lossin" <benno.lossin@proton.me>,
"Andreas Hindborg" <a.hindborg@samsung.com>,
rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rust: add `ARef::into_raw`
Date: Fri, 2 Aug 2024 07:20:04 -0700 [thread overview]
Message-ID: <ZqzrFEbBAbHmil-j@boqun-archlinux> (raw)
In-Reply-To: <CAH5fLgiHc7azNtwTKNoLP93-APMqkK6vGFKYSEPepWoyNgNjrA@mail.gmail.com>
On Thu, Aug 01, 2024 at 04:45:02PM +0200, Alice Ryhl wrote:
> On Thu, Aug 1, 2024 at 4:17 PM Alice Ryhl <aliceryhl@google.com> wrote:
> >
> > Add a method for `ARef` that is analogous to `Arc::into_raw`. It is the
> > inverse operation of `ARef::from_raw`, and allows you to convert the
> > `ARef` back into a raw pointer while retaining ownership of the
> > refcount.
> >
> > This new function will be used by [1] for converting the type in an
> > `ARef` using `ARef::from_raw(ARef::into_raw(me).cast())`. The author has
> > also needed the same function for other use-cases in the past, but [1]
> > is the first to go upstream.
> >
> > Link: https://lore.kernel.org/r/20240801-vma-v3-1-db6c1c0afda9@google.com [1]
> > Signed-off-by: Alice Ryhl <aliceryhl@google.com>
>
> Actually I just realized that there's already another use on the list in
> https://lore.kernel.org/all/20240725-alice-file-v8-0-55a2e80deaa8@google.com/
Yes, I was about to point this out ;-)
I picked this up in rust-dev and rebased file patches onto it for
testing purpose.
In the meanwhile,
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Regards,
Boqun
next prev parent reply other threads:[~2024-08-02 14:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-01 14:16 [PATCH] rust: add `ARef::into_raw` Alice Ryhl
2024-08-01 14:45 ` Alice Ryhl
2024-08-02 14:20 ` Boqun Feng [this message]
2024-08-01 15:06 ` Danilo Krummrich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZqzrFEbBAbHmil-j@boqun-archlinux \
--to=boqun.feng@gmail.com \
--cc=a.hindborg@samsung.com \
--cc=alex.gaynor@gmail.com \
--cc=aliceryhl@google.com \
--cc=benno.lossin@proton.me \
--cc=bjorn3_gh@protonmail.com \
--cc=gary@garyguo.net \
--cc=linux-kernel@vger.kernel.org \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=wedsonaf@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).