rust/library/alloc/src
bors 6b6c1ffacc 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.
2022-05-02 09:05:22 +00:00
..
alloc Rename AllocRef to Allocator and (de)alloc to (de)allocate 2020-12-04 14:47:15 +01:00
boxed Add ThinBox type for 1 stack pointer sized heap allocated trait objects 2022-04-08 09:00:16 -07:00
collections Rollup merge of #94126 - ssomers:alloc_prep_1, r=Mark-Simulacrum 2022-05-02 10:41:54 +09:00
ffi Fix targets not supporting target_has_atomic = "ptr" 2022-04-14 21:53:11 +03:00
raw_vec Add a unit test for zero-sized types in RawVec. 2021-11-26 19:30:45 +11:00
rc Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00
sync Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00
vec Auto merge of #96596 - scottmcm:limited-calloc, r=Mark-Simulacrum 2022-05-02 09:05:22 +00:00
alloc.rs trivial cfg(bootstrap) changes 2022-04-05 23:18:40 +02:00
borrow.rs Rollup merge of #94022 - jongiddy:cow-into-owned-docs, r=Dylan-DPC 2022-04-26 13:22:26 +02:00
boxed.rs impl const Default for Box<[T]> and Box<str> 2022-04-11 12:14:18 -07:00
fmt.rs std::fmt: Improved list of formatting macros 2022-05-01 15:27:41 +02:00
lib.rs library: Use type aliases to make CStr(ing) in libcore/liballoc unstable 2022-04-14 21:53:11 +03:00
macros.rs alloc: make vec! unavailable under no_global_oom_handling 2022-04-16 06:31:41 +02:00
raw_vec.rs formatting 2022-04-06 01:36:46 +05:30
rc.rs Auto merge of #96078 - udoprog:refcounted-str-to-u8, r=dtolnay 2022-05-01 06:41:59 +00:00
slice.rs library: Move CStr to libcore, and CString to liballoc 2022-04-14 21:53:11 +03:00
str.rs trivial cfg(bootstrap) changes 2022-04-05 23:18:40 +02:00
string.rs Clarify docs for from_raw_parts 2022-04-19 21:12:55 +01:00
sync.rs Bump shared_from_str to Rust 1.62.0 2022-04-30 23:40:35 -07:00
task.rs Document From implementations for Waker and RawWaker 2021-04-22 14:16:33 -07:00
tests.rs Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00