Thread (2 messages) 2 messages, 2 authors, 2021-05-22

[KernelAllocator] Usage of GlobalAlloc

From: Hanqing Zhao <hidden>
Date: 2021-05-21 17:42:55

Hi all,

While implementing an alloc crate, I intend to pass custom parameters
and extra parameters such as
memory flags (GFP_KERNEL, GFP_ATOMIC, etc) through the `Layout` parameter.

However, the current implementation of GlobalAlloc
(https://github.com/Rust-for-Linux/linux/blob/rust/rust/kernel/allocator.rs#L13)
is not actually used,
because the kernel allocation directly resorts to `__rust_alloc`
( https://github.com/Rust-for-Linux/linux/blob/rust/rust/kernel/allocator.rs\#L34),
`__rust_dealloc`, etc.

In this way, it hinders me to use the `layout` parameter.
Is this intended or avoidable?

Best,
Hanqing Zhao
Georgia Tech
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help