]> www.infradead.org Git - users/willy/pagecache.git/commit
rust: alloc: Add realloc and alloc_zeroed to the GlobalAlloc impl
authorBjörn Roy Baron <bjorn3_gh@protonmail.com>
Sun, 25 Jun 2023 23:25:28 +0000 (16:25 -0700)
committerMiguel Ojeda <ojeda@kernel.org>
Sat, 29 Jul 2023 14:00:11 +0000 (16:00 +0200)
commit7c74839b2acc9b5a5d16d3a1737741dd64e1804b
treed820619bc367dd735376f6c9b774d87cb66b6a27
parentd0132312537cdbd42285b7cb90b5bfb49897c55a
rust: alloc: Add realloc and alloc_zeroed to the GlobalAlloc impl

While there are default impls for these methods, using the respective C
api's is faster. Currently neither the existing nor these new
GlobalAlloc method implementations are actually called. Instead the
__rust_* function defined below the GlobalAlloc impl are used. With
rustc 1.71 these functions will be gone and all allocation calls will go
through the GlobalAlloc implementation.

Link: https://github.com/Rust-for-Linux/linux/issues/68
Signed-off-by: Björn Roy Baron <bjorn3_gh@protonmail.com>
[boqun: add size adjustment for alignment requirement]
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Reviewed-by: Gary Guo <gary@garyguo.net>
Link: https://lore.kernel.org/r/20230625232528.89306-1-boqun.feng@gmail.com
[ Reset commit author to Björn and fixed a few typos in code comments. ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/kernel/allocator.rs