diff options
| author | Scott McMurray <scottmcm@users.noreply.github.com> | 2024-09-01 01:31:07 -0700 |
|---|---|---|
| committer | Scott McMurray <scottmcm@users.noreply.github.com> | 2024-09-17 20:05:57 -0700 |
| commit | 18ca8bf8ee77deb13967620b1f4829f22c16dae1 (patch) | |
| tree | 9dc91658b3defbed14626de1d7179556ecee6e6f /compiler/rustc_codegen_llvm/src | |
| parent | d571ae851d93541bef826c3c48c1e9ad99da77d6 (diff) | |
| download | rust-18ca8bf8ee77deb13967620b1f4829f22c16dae1.tar.gz rust-18ca8bf8ee77deb13967620b1f4829f22c16dae1.zip | |
Take more advantage of the `isize::MAX` limit in `Layout`
Things like `padding_needed_for` are current implemented being super careful to handle things like `Layout::size` potentially being `usize::MAX`. But now that 95295 has happened, that's no longer a concern. It's possible to add two `Layout::size`s together without risking overflow now. So take advantage of that to remove a bunch of checked math that's not actually needed. For example, the round-up-and-add-next-size in `extend` doesn't need any overflow checks at all, just the final check for compatibility with the alignment. (And while I was doing that I made it all unstably const, because there's nothing in `Layout` that's fundamentally runtime-only.)
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions
