rust/library/alloc
Loïc BRANSTETT a98abe83eb Improve codegen of String::retain method.
Using unwrap_unchecked helps the optimizer to not generate panicking
path, that will never be taken for valid UTF-8 like string.

Using encode_utf8 saves us a call to a memcpy, as the optimizer is
unable to realize that ch_len <= 4 and so can generate much better
assembly code.

https://rust.godbolt.org/z/z73ohenfc
2022-05-01 19:25:14 +02:00
..
benches Add debug assertions to some unsafe functions 2022-03-29 11:05:24 -04:00
src Improve codegen of String::retain method. 2022-05-01 19:25:14 +02:00
tests library: Use type aliases to make CStr(ing) in libcore/liballoc unstable 2022-04-14 21:53:11 +03:00
Cargo.toml Switch all libraries to the 2021 edition 2021-12-23 19:03:47 +08:00