dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Boqun Feng <boqun@kernel.org>
To: Alice Ryhl <aliceryhl@google.com>
Cc: sashiko-reviews@lists.linux.dev, ojeda@kernel.org,
	dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org
Subject: Re: [PATCH 1/3] rust: rcu: add RcuBox type
Date: Fri, 5 Jun 2026 08:33:26 -0700	[thread overview]
Message-ID: <aiLsRpKWnRk5DQBd@tardis-2.local> (raw)
In-Reply-To: <CAH5fLgimUgbK_dVwq7RQimOugqJka2bM_u2r5S=3aze_8uCnbA@mail.gmail.com>

On Fri, Jun 05, 2026 at 04:54:55PM +0200, Alice Ryhl wrote:
[..]
> >
> > [Cc Alice]
> >
> > I fixed this locally by:
> >
> >     fn into_foreign(self) -> *mut c_void {
> >         let ptr = self.0.as_ptr().cast();
> >
> >         // FORGET: Leaking it as a pointer, the caller is responsible to free it or unleak it by
> >         // from_foreign().
> >         core::mem::forget(self);
> >
> >         ptr
> >     }
> 
> I prefer to avoid use core::mem::forget.
> 
>     ManuallyDrop(self).0.as_ptr().cast()
> 

Sounds good ;-)

Regards,
Boqun

> Alice

  reply	other threads:[~2026-06-05 15:33 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-05 13:35 [PATCH 0/3] rust: sync: Introduce Rcu*Box Boqun Feng
2026-06-05 13:35 ` [PATCH 1/3] rust: rcu: add RcuBox type Boqun Feng
2026-06-05 13:38   ` Boqun Feng
2026-06-05 13:49   ` sashiko-bot
2026-06-05 13:58     ` Boqun Feng
2026-06-05 14:41     ` Boqun Feng
2026-06-05 14:54       ` Alice Ryhl
2026-06-05 15:33         ` Boqun Feng [this message]
2026-06-05 13:35 ` [PATCH 1/3] rust: rcu: Add " Boqun Feng
2026-06-05 13:35 ` [PATCH 2/3] rust: maple_tree: add load_rcu() Boqun Feng
2026-06-05 13:38   ` Boqun Feng
2026-06-05 13:51   ` sashiko-bot
2026-06-05 13:35 ` [PATCH 2/3] rust: maple_tree: Add load_rcu() Boqun Feng
2026-07-15 14:09   ` Alice Ryhl
2026-06-05 13:35 ` [RFC PATCH 3/3] rust: rcu: Introduce RcuFreeBox Boqun Feng
2026-06-05 13:46   ` sashiko-bot
2026-06-05 14:04   ` Alice Ryhl
2026-06-05 14:20     ` Boqun Feng
2026-06-05 14:54       ` Alice Ryhl
2026-06-05 14:04   ` Boqun Feng

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=aiLsRpKWnRk5DQBd@tardis-2.local \
    --to=boqun@kernel.org \
    --cc=aliceryhl@google.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-media@vger.kernel.org \
    --cc=ojeda@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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