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@xxxxxxxxxxxxxx>
[boqun: add size adjustment for alignment requirement]
Signed-off-by: Boqun Feng <boqun.feng@xxxxxxxxx>
---
Miguel, I fold my diff into Björn's original patch and make a v2, it
relies on the other patch:
https://lore.kernel.org/rust-for-linux/6e61f06f-2411-0bcb-926b-0a6927096f20@xxxxxxxxx/
So this v2 (if all goes well) is targeted for v6.6, JFYI.
v1 -> v2:
* Add size adjustment for align requirement.
[...]