os-rust/library/core
Scott McMurray 18ca8bf8ee 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.)
2024-09-17 20:05:57 -07:00
..
benches Improve isqrt tests and add benchmarks 2024-08-28 23:06:54 -04:00
src Take more advantage of the isize::MAX limit in Layout 2024-09-17 20:05:57 -07:00
tests Rollup merge of #129640 - saethlin:unignore-android-in-alloc, r=tgross35 2024-08-31 10:08:54 +02:00
Cargo.toml Cleanup bootstrap check-cfg 2024-06-27 11:30:03 +02:00