]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
rust: alloc: add `Allocator` trait
authorDanilo Krummrich <dakr@kernel.org>
Fri, 7 Mar 2025 22:49:27 +0000 (23:49 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Mar 2025 12:01:43 +0000 (13:01 +0100)
commit4b773fe5668d07899ae07c006949f7b0dcd45848
tree4d2597ee23163cd4c9b014629b9ddc7471adae45
parent311d5ecf16c69e691205e0e441e64e8bf1bf2840
rust: alloc: add `Allocator` trait

commit b7a084ba4fbb8f416ce8d19c93a3a2bee63c9c89 upstream.

Add a kernel specific `Allocator` trait, that in contrast to the one in
Rust's core library doesn't require unstable features and supports GFP
flags.

Subsequent patches add the following trait implementors: `Kmalloc`,
`Vmalloc` and `KVmalloc`.

Reviewed-by: Alice Ryhl <aliceryhl@google.com>
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-2-dakr@kernel.org
[ Fixed typo. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
rust/kernel/alloc.rs