FastLED 3.9.15
Loading...
Searching...
No Matches

◆ reserve()

template<typename T, size_t INLINED_SIZE>
void fl::InlinedVector< T, INLINED_SIZE >::reserve ( size_t size)
inline

Definition at line 859 of file vector.h.

859 {
860 if (size > INLINED_SIZE) {
861 if (mUsingHeap) {
862 mHeap.reserve(size);
863 } else {
864 mHeap.reserve(size);
865 for (auto &v : mFixed) {
866 mHeap.push_back(v);
867 }
868 mFixed.clear();
869 mUsingHeap = true;
870 }
871 } else {
872 if (mUsingHeap) {
873 mFixed.reserve(size);
874 for (auto &v : mHeap) {
875 mFixed.push_back(v);
876 }
877 mHeap.clear();
878 mUsingHeap = false;
879 } else {
880 mFixed.reserve(size);
881 }
882 }
883 }
HeapVector< T > mHeap
Definition vector.h:1071
FixedVector< T, INLINED_SIZE > mFixed
Definition vector.h:1070
size_t size() const
Definition vector.h:912

References mFixed, mHeap, mUsingHeap, and size().

+ Here is the call graph for this function: