FastLED 3.10.9
Loading...
Searching...
No Matches

◆ shrink_to_fit()

template<typename T>
void fl::deque< T >::shrink_to_fit ( )
inline

Definition at line 575 of file deque.h.

575 {
576 if (mSize == 0) {
577 // Release every chunk and the map itself.
578 for (fl::size i = 0; i < mMapCapacity; ++i) {
580 mMap[i] = nullptr;
581 }
583 mMap = nullptr;
584 mMapCapacity = 0;
585 mFrontMapIdx = 0;
586 mFrontOffset = 0;
587 return;
588 }
589 // Release chunks outside [front .. back].
591 for (fl::size i = 0; i < mMapCapacity; ++i) {
594 mMap[i] = nullptr;
595 }
596 }
597 }
void deallocate_chunk(T *chunk) FL_NO_EXCEPT
Definition deque.h:49
fl::size mMapCapacity
Definition deque.h:39
void deallocate_map(T **map, fl::size capacity) FL_NO_EXCEPT
Definition deque.h:65
fl::size mSize
Definition deque.h:42
fl::size used_chunks() const FL_NO_EXCEPT
Definition deque.h:80
fl::size mFrontOffset
Definition deque.h:41
T ** mMap
Definition deque.h:38
fl::size mFrontMapIdx
Definition deque.h:40