commit | 76557f5a2452262bcabcc58ff54db5a3c0839c88 | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Fri Mar 18 10:09:35 2022 +0000 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Fri Mar 18 10:09:35 2022 +0000 |
tree | 8a0aaf450d87ced0b38394bff96d3d54d2ee92be | |
parent | b65f07e1b7532f1c7e4377a03da920751e424dd8 [diff] | |
parent | 6d4e4f96996850ec34ca390f05f43a6ea6f9132f [diff] |
Snap for 8319971 from 6d4e4f96996850ec34ca390f05f43a6ea6f9132f to t-keystone-qcom-release Change-Id: I6dde9990ecf3ba0ba4a17cf43633de41a2558d6d
"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();