Draft: Alternative allocator support
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest8 patches 15 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/8 | rust: alloc: re-enable allocator_apirust/ | +1 | 0 replies | |
| 2/8 | rust: alloc: use AllocError from core::allocrust/ rust/ rust/ +5 more | +14 | 0 replies | |
| 3/8 | rust: alloc: implement AllocatorWithFlags traitrust/ | +21 | 7 replies | |
| 4/8 | rust: alloc: separate krealloc_aligned()rust/ | +21 | 0 replies | |
| 5/8 | rust: alloc: implement AllocatorWithFlags for KernelAllocatorrust/ rust/ | +37 | 2 replies | |
| 6/8 | rust: alloc: implement BoxExtAllocrust/ | +39 | 4 replies | |
| 7/8 | rust: alloc: implement VecExtAllocrust/ | +84 | 0 replies | |
| 8/8 | rust: alloc: implement vmalloc allocatorrust/ | +37 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH WIP 0/8] Draft: Alternative allocator support
DISCLAIMER: This patch series does not raise a claim for inclusion in the kernel (yet) and, instead, serves as a baseline for further discussion.
Hi,
This patch series re-enables the allocator_api and implements an extension trait AllocatorWithFlags expanding the Allocator trait to allow for arbitrary allocator implementations.
It expands Box<T, A> and Vec<T, A> by adding the BoxExtAlloc<T, A> and VecExtAlloc<T, A> traits analogous to the existing BoxExt<T> and VecExt<T> traits and, as an example, implements the VmAllocator (vmalloc).
This patch series is tested (I tested the VecExtAlloc<T, A> parts using my firmware abstractions) and it seems to work quite well. However, since it's just a draft there are no proper commit messages, no documentation and no safety comments.
Also, I'm pretty sure there are some parts of BoxExtAlloc<T, A> and VecExtAlloc<T, A> that, somehow, can be generalized with the existing BoxExt<T> and VecExt<T> implementations.
Please let me know what you think.
- Danilo
Danilo Krummrich (8):
rust: alloc: re-enable allocator_api
rust: alloc: use AllocError from core::alloc
rust: alloc: implement AllocatorWithFlags trait
rust: alloc: separate krealloc_aligned()
rust: alloc: implement AllocatorWithFlags for KernelAllocator
rust: alloc: implement BoxExtAlloc
rust: alloc: implement VecExtAlloc
rust: alloc: implement vmalloc allocator
rust/kernel/alloc.rs | 25 ++++++-- rust/kernel/alloc/allocator.rs | 103 ++++++++++++++++++++++++++++++--- rust/kernel/alloc/box_ext.rs | 41 ++++++++++++- rust/kernel/alloc/vec_ext.rs | 86 ++++++++++++++++++++++++++- rust/kernel/error.rs | 3 +- rust/kernel/init.rs | 3 +- rust/kernel/lib.rs | 1 + rust/kernel/str.rs | 3 +- rust/kernel/sync/arc.rs | 4 +- rust/kernel/workqueue.rs | 3 +- 10 files changed, 251 insertions(+), 21 deletions(-)
base-commit: 2c1092853f163762ef0aabc551a630ef233e1be3
Signature · 1 line
2.44.0