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 813 of file vector.h.

813 {
814 if (size > INLINED_SIZE) {
815 if (mUsingHeap) {
816 mHeap.reserve(size);
817 } else {
818 mHeap.reserve(size);
819 for (auto &v : mFixed) {
820 mHeap.push_back(v);
821 }
822 mFixed.clear();
823 mUsingHeap = true;
824 }
825 } else {
826 if (mUsingHeap) {
827 mFixed.reserve(size);
828 for (auto &v : mHeap) {
829 mFixed.push_back(v);
830 }
831 mHeap.clear();
832 mUsingHeap = false;
833 } else {
834 mFixed.reserve(size);
835 }
836 }
837 }
HeapVector< T > mHeap
Definition vector.h:1025
FixedVector< T, INLINED_SIZE > mFixed
Definition vector.h:1024
size_t size() const
Definition vector.h:866

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

+ Here is the call graph for this function: