Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
never construct value on stack in new_box_zeroed (#1601)
On lower opt-levels the compiler might not optimize out the `layout.size() == 0` branch and emits code for the if-body. This will cause a stack allocation for `Self`. Avoid calling new_zeroed() and directly construct the Box from a dangling pointer instead. Co-authored-by: Joshua Liebow-Feeser <[email protected]>
- Loading branch information