diff options
author | Benno Lossin <benno.lossin@proton.me> | 2024-08-19 14:24:39 +0300 |
---|---|---|
committer | Miguel Ojeda <ojeda@kernel.org> | 2024-08-22 01:16:16 +0300 |
commit | 6d1c22d0ace31d096b0dab5318c6a0d3219d6456 (patch) | |
tree | a26b0a491e2b3265b3a59960ba786c7043fc6320 /rust/kernel/alloc.rs | |
parent | 01db99b272318da75a1aa5a81f75adb9d32f676e (diff) | |
download | linux-6d1c22d0ace31d096b0dab5318c6a0d3219d6456.tar.xz |
rust: init: add `write_[pin_]init` functions
Sometimes it is necessary to split allocation and initialization into
two steps. One such situation is when reusing existing allocations
obtained via `Box::drop_contents`. See [1] for an example.
In order to support this use case add `write_[pin_]init` functions to the
pin-init API. These functions operate on already allocated smart
pointers that wrap `MaybeUninit<T>`.
Link: https://lore.kernel.org/rust-for-linux/f026532f-8594-4f18-9aa5-57ad3f5bc592@proton.me/ [1]
Signed-off-by: Benno Lossin <benno.lossin@proton.me>
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Link: https://lore.kernel.org/r/20240819112415.99810-2-benno.lossin@proton.me
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'rust/kernel/alloc.rs')
0 files changed, 0 insertions, 0 deletions