linux/rust
Danilo Krummrich 2aac4cd7da rust: alloc: implement kernel Vec type
`Vec` provides a contiguous growable array type with contents allocated
with the kernel's allocators (e.g. `Kmalloc`, `Vmalloc` or `KVmalloc`).

In contrast to Rust's stdlib `Vec` type, the kernel `Vec` type considers
the kernel's GFP flags for all appropriate functions, always reports
allocation failures through `Result<_, AllocError>` and remains
independent from unstable features.

[ This patch starts using a new unstable feature, `inline_const`, but
  it was stabilized in Rust 1.79.0, i.e. the next version after the
  minimum one, thus it will not be an issue. - Miguel ]

Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Link: https://lore.kernel.org/r/20241004154149.93856-17-dakr@kernel.org
[ Cleaned `rustdoc` unescaped backtick warning, added a couple more
  backticks elsewhere, fixed typos, sorted `feature`s, rewrapped
  documentation lines. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2024-10-15 23:10:32 +02:00
..
bindings rust: alloc: add __GFP_NOWARN to Flags 2024-10-15 22:56:59 +02:00
helpers rust: alloc: implement KVmalloc allocator 2024-10-15 22:56:59 +02:00
kernel rust: alloc: implement kernel Vec type 2024-10-15 23:10:32 +02:00
macros rust: treewide: switch to our kernel Box type 2024-10-15 22:56:59 +02:00
uapi rust: enable clippy::undocumented_unsafe_blocks lint 2024-10-07 21:39:05 +02:00
.gitignore rust: support running Rust documentation tests as KUnit ones 2023-07-19 09:32:53 -06:00
bindgen_parameters rust: fix ARCH_SLAB_MINALIGN multiple definition error 2024-09-26 17:52:35 +02:00
build_error.rs rust: add build_error crate 2022-12-04 01:59:16 +01:00
compiler_builtins.rs rust: add intrinsics to fix -Os builds 2024-08-10 00:05:10 +02:00
exports.c rust: kbuild: auto generate helper exports 2024-08-19 11:09:02 +02:00
Makefile rust: enable rustdoc::unescaped_backticks lint 2024-10-07 21:39:05 +02:00