diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2021-12-22 05:13:41 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2021-12-22 05:13:41 +1100 |
| commit | 8217138f445e128f3bd4e4f517ac989d2abb621f (patch) | |
| tree | 9edcc44f958c5eb4f0d2fc1e93ddf6ddc761bdd5 /compiler/rustc_codegen_llvm/src/llvm/mod.rs | |
| parent | e95e084a14870a718c712936ab5a8f8cd0159485 (diff) | |
| download | rust-8217138f445e128f3bd4e4f517ac989d2abb621f.tar.gz rust-8217138f445e128f3bd4e4f517ac989d2abb621f.zip | |
RawVec: don't recompute capacity after allocating.
Currently it sets the capacity to `ptr.len() / mem::size_of::<T>()` after any buffer allocation/reallocation. This would be useful if allocators ever returned a `NonNull<[u8]>` with a size larger than requested. But this never happens, so it's not useful. Removing this slightly reduces the size of generated LLVM IR, and slightly speeds up the hot path of `RawVec` growth.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/llvm/mod.rs')
0 files changed, 0 insertions, 0 deletions
