tag | eae44456752068aded0e3c167b349fc582113e58 | |
---|---|---|
tagger | The Android Open Source Project <initial-contribution@android.com> | Wed Aug 31 06:29:58 2022 -0700 |
object | 2c695b7daba7bbc90a3541ca0e8c319b19222d21 |
t_frc_art_330443060
commit | 2c695b7daba7bbc90a3541ca0e8c319b19222d21 | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Thu Apr 28 16:01:23 2022 +0000 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Thu Apr 28 16:01:23 2022 +0000 |
tree | da86de748981dd96113865df11834b360d9da02b | |
parent | bcbb2293e68b7ea9e451b4af2b3c5474708b6f59 [diff] | |
parent | 638d0ee87b2ef1082fe674e75f89932b179fe32a [diff] |
Snap for 8512216 from 638d0ee87b2ef1082fe674e75f89932b179fe32a to tm-frc-art-release Change-Id: Ia80028e85a8c744250d43ec93a01b8f9bf1b693d
“Small vector” optimization for Rust: store up to a small number of items on the stack
use smallvec::{SmallVec, smallvec}; // This SmallVec can hold up to 4 items on the stack: let mut v: SmallVec<[i32; 4]> = smallvec![1, 2, 3, 4]; // It will automatically move its contents to the heap if // contains more than four items: v.push(5); // SmallVec points to a slice, so you can use normal slice // indexing and other methods to access its contents: v[0] = v[1] + v[2]; v.sort();