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

◆ ensure_size()

template<typename T>
void fl::HeapVector< T >::ensure_size ( size_t n)
inline

Definition at line 258 of file vector.h.

258 {
259 if (n > mCapacity) {
260 size_t new_capacity = (3*mCapacity) / 2;
261 if (new_capacity < n) {
262 new_capacity = n;
263 }
265 for (size_t i = 0; i < mSize; ++i) {
266 new_array[i] = mArray[i];
267 }
268 // mArray = std::move(new_array);
269 mArray.reset();
270 mArray.reset(new_array.release());
272 }
273 }
size_t mCapacity
Definition vector.h:220
fl::scoped_array< T > mArray
Definition vector.h:218
size_t mSize
Definition vector.h:221

Referenced by fl::HeapVector< DrawItem >::push_back(), and fl::HeapVector< DrawItem >::reserve().

+ Here is the caller graph for this function: