2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00
linux/rust/kernel/alloc
Alice Ryhl 47d8101924 rust: vec: impl Default for Vec with any allocator
The implementation of Default is restricted to only work with kmalloc
vectors for no good reason. This means I have to use

	mem::replace(&mut my_vec, KVVec::new())

in Rust Binder instead of `mem::take(&mut my_vec)`. Thus, expand the
impl of Default to work with any allocator including kvmalloc.

Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Benno Lossin <lossin@kernel.org>
Link: https://lore.kernel.org/r/20250610-vec-default-v1-1-7bb2c97d75a0@google.com
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
2025-06-11 16:35:10 +02:00
..
kvec rust: alloc: add Vec::insert_within_capacity 2025-05-07 18:40:45 +02:00
allocator_test.rs rust: alloc: add missing Markdown code span 2025-05-25 22:58:35 +02:00
allocator.rs rust: alloc: make ReallocFunc::call inline 2025-03-06 20:49:06 +01:00
kbox.rs Alloc changes for v6.16 2025-05-18 20:56:03 +02:00
kvec.rs rust: vec: impl Default for Vec with any allocator 2025-06-11 16:35:10 +02:00
layout.rs rust: alloc: add doctest for ArrayLayout::new() 2025-01-13 23:45:30 +01:00