FastLED 3.10.10
Loading...
Searching...
No Matches

◆ reserve()

template<typename T>
void fl::deque< T >::reserve ( fl::size n)
inline

Definition at line 549 of file deque.h.

549 {
550 if (n <= capacity()) return;
551 // Allocate enough chunks behind the current front-offset to hold n total.
556 // Ensure mMap has room for `extra` more chunks past current back.
559 grow_map(0, extra);
560 }
561 // Allocate chunks at the back to cover [front .. front+n).
563 for (fl::size i = 0; i < extra; ++i) {
564 if (first_new + i >= mMapCapacity) break;
565 if (mMap[first_new + i] == nullptr) {
567 }
568 }
569 }
570 }
fl::size capacity() const FL_NO_EXCEPT
Definition deque.h:535
fl::size mMapCapacity
Definition deque.h:39
static constexpr fl::size kChunkSize
Definition deque.h:36
fl::size mSize
Definition deque.h:42
T * allocate_chunk() FL_NO_EXCEPT
Definition deque.h:45
fl::size used_chunks() const FL_NO_EXCEPT
Definition deque.h:80
fl::size mFrontOffset
Definition deque.h:41
void grow_map(fl::size extra_front, fl::size extra_back) FL_NO_EXCEPT
Definition deque.h:97
T ** mMap
Definition deque.h:38
fl::size mFrontMapIdx
Definition deque.h:40