about summary refs log tree commit diff
path: root/src/librustdoc/html/static/js/source-script.js
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-05-02 09:05:22 +0000
committerbors <bors@rust-lang.org>2022-05-02 09:05:22 +0000
commit6b6c1ffacc5df738b3560369746d87499adbeae1 (patch)
tree5e27b6bf9e8c16318305cd0b2fc05e44ca89e8ec /src/librustdoc/html/static/js/source-script.js
parent905fd731543ee837bd9f4cf960b048610d037155 (diff)
parent2830dbd64f50b4a8025025f01578e45cbf9d3719 (diff)
downloadrust-6b6c1ffacc5df738b3560369746d87499adbeae1.tar.gz
rust-6b6c1ffacc5df738b3560369746d87499adbeae1.zip
Auto merge of #96596 - scottmcm:limited-calloc, r=Mark-Simulacrum
Tweak the vec-calloc runtime check to only apply to shortish-arrays

r? `@Mark-Simulacrum`

`@nbdd0121` pointed out in https://github.com/rust-lang/rust/pull/95362#issuecomment-1114085395 that LLVM currently doesn't constant-fold the `IsZero` check for long arrays, so that seems like a reasonable justification for limiting it.

It appears that it's based on length, not byte size, (https://godbolt.org/z/4s48Y81dP), so that's what I used in the PR.  Maybe it's a ["the number of inlining shall be three"](https://youtu.be/s4wnuiCwTGU?t=320) sort of situation.

Certainly there's more that could be done here -- that generated code that checks long arrays byte-by-byte is highly suboptimal, for example -- but this is an easy, low-risk tweak.
Diffstat (limited to 'src/librustdoc/html/static/js/source-script.js')
0 files changed, 0 insertions, 0 deletions