rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Benno Lossin <benno.lossin@proton.me>
To: Alice Ryhl <aliceryhl@google.com>, Danilo Krummrich <dakr@kernel.org>
Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/5] rust: alloc: add Vec::push_within_capacity
Date: Thu, 20 Mar 2025 22:17:10 +0000	[thread overview]
Message-ID: <D8LFWBYIFHSP.ZR8DMPGGM9SE@proton.me> (raw)
In-Reply-To: <20250320-vec-methods-v1-3-7dff5cf25fe8@google.com>

On Thu Mar 20, 2025 at 2:52 PM CET, Alice Ryhl wrote:
> This introduces a new method called `push_within_capacity` for appending
> to a vector without attempting to allocate if the capacity is full. Rust
> Binder will use this in various places to safely push to a vector while
> holding a spinlock.
>
> The existing Vec::push method is reimplemented in terms of the new
> method.
>
> Signed-off-by: Alice Ryhl <aliceryhl@google.com>

Reviewed-by: Benno Lossin <benno.lossin@proton.me>

---
Cheers,
Benno

> ---
>  rust/kernel/alloc/kvec.rs | 25 +++++++++++++++++++++++++
>  1 file changed, 25 insertions(+)


  reply	other threads:[~2025-03-20 22:17 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-20 13:52 [PATCH 0/5] Additional methods for Vec Alice Ryhl
2025-03-20 13:52 ` [PATCH 1/5] rust: alloc: add Vec::clear Alice Ryhl
2025-03-20 22:01   ` Benno Lossin
2025-03-20 22:04   ` Tamir Duberstein
2025-03-20 13:52 ` [PATCH 2/5] rust: alloc: add Vec::pop Alice Ryhl
2025-03-20 13:52 ` [PATCH 3/5] rust: alloc: add Vec::push_within_capacity Alice Ryhl
2025-03-20 22:17   ` Benno Lossin [this message]
2025-03-21 15:22   ` Tamir Duberstein
2025-03-20 13:52 ` [PATCH 4/5] rust: alloc: add Vec::drain_all Alice Ryhl
2025-03-20 22:12   ` Tamir Duberstein
2025-03-21  7:41     ` Alice Ryhl
2025-03-20 13:53 ` [PATCH 5/5] rust: alloc: add Vec::retain Alice Ryhl
2025-03-21 15:24   ` Tamir Duberstein
2025-04-22  9:48     ` Alice Ryhl
2025-03-21 12:11 ` [PATCH 0/5] Additional methods for Vec Alice Ryhl

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=D8LFWBYIFHSP.ZR8DMPGGM9SE@proton.me \
    --to=benno.lossin@proton.me \
    --cc=aliceryhl@google.com \
    --cc=dakr@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    /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).