rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [KernelAllocator] Usage of GlobalAlloc
@ 2021-05-21 17:42 Hanqing Zhao
  2021-05-22  8:22 ` Gary Guo
  0 siblings, 1 reply; 4+ messages in thread
From: Hanqing Zhao @ 2021-05-21 17:42 UTC (permalink / raw)
  To: rust-for-linux

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-05-22 20:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-21 17:42 [KernelAllocator] Usage of GlobalAlloc Hanqing Zhao
2021-05-22  8:22 ` Gary Guo
     [not found]   ` <CAKmvQ+UpHb0tBbYo9pR-YJa=SC3bd2T8pE_R8tLkOqKCsK9kXA@mail.gmail.com>
2021-05-22 19:17     ` Gary Guo
2021-05-22 20:30       ` Hanqing Zhao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).