diff options
author | Benno Lossin <[email protected]> | 2024-08-19 11:24:35 +0000 |
---|---|---|
committer | Miguel Ojeda <[email protected]> | 2024-08-22 00:16:06 +0200 |
commit | 01db99b272318da75a1aa5a81f75adb9d32f676e (patch) | |
tree | 28406b1298bafefab366598dd182cfebe38d9f74 /tools/perf/scripts/python/task-analyzer.py | |
parent | 76501d19c6af43054492420ae53a9bd2d4de50b3 (diff) |
rust: kernel: add `drop_contents` to `BoxExt`
Sometimes (see [1]) it is necessary to drop the value inside of a
`Box<T>`, but retain the allocation. For example to reuse the allocation
in the future.
Introduce a new function `drop_contents` that turns a `Box<T>` into
`Box<MaybeUninit<T>>` by dropping the value.
Link: https://lore.kernel.org/rust-for-linux/[email protected]/ [1]
Signed-off-by: Benno Lossin <[email protected]>
Reviewed-by: Boqun Feng <[email protected]>
Reviewed-by: Alice Ryhl <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Miguel Ojeda <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/task-analyzer.py')
0 files changed, 0 insertions, 0 deletions