Commit 83132963 authored by Alice Ryhl's avatar Alice Ryhl Committed by Matthew Maurer
Browse files

FROMGIT: rust: alloc: add Vec::insert_within_capacity



This adds a variant of Vec::insert that does not allocate memory. This
makes it safe to use this function while holding a spinlock. Rust Binder
uses it for the range allocator fast path.

Signed-off-by: default avatarAlice Ryhl <aliceryhl@google.com>
Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: default avatarBenno Lossin <lossin@kernel.org>
Link: https://lore.kernel.org/r/20250502-vec-methods-v5-7-06d20ad9366f@google.com


Signed-off-by: default avatarDanilo Krummrich <dakr@kernel.org>

Bug: 414994413
(cherry picked from commit 771c5a7d
 https://github.com/Rust-for-Linux/linux.git

 alloc-next)
Change-Id: I5661d5ee9ff239a92c4a640e334ad6d60196ad25
Signed-off-by: default avatarAlice Ryhl <aliceryhl@google.com>
parent c28afde0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment