diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2025-02-21 12:45:22 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-21 12:45:22 +0100 |
| commit | 8d52aae968e8a4822e3a4c902c148a2280657eb6 (patch) | |
| tree | 0e2b270af0dd12a7f704f8bfd578d820cb72c6a1 /compiler/rustc_codegen_llvm/src | |
| parent | e67d4499a61cfe5c4e6ff257e05ced2de652d5b6 (diff) | |
| parent | 97005678c38fd391c9b502d011cc3f3d4434a18a (diff) | |
| download | rust-8d52aae968e8a4822e3a4c902c148a2280657eb6.tar.gz rust-8d52aae968e8a4822e3a4c902c148a2280657eb6.zip | |
Rollup merge of #136089 - jwong101:box-default-debug-stack-usage, r=Amanieu
Reduce `Box::default` stack copies in debug mode The `Box::new(T::default())` implementation of `Box::default` only had two stack copies in debug mode, compared to the current version, which has four. By avoiding creating any `MaybeUninit<T>`'s and just writing `T` directly to the `Box` pointer, the stack usage in debug mode remains the same as the old version. Another option would be to mark `Box::write` as `#[inline(always)]`, and change it's implementation to to avoid calling `MaybeUninit::write` (which creates a `MaybeUninit<T>` on the stack) and to use `ptr::write` instead. Fixes: #136043
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions
