FastLED 3.10.6
Loading...
Searching...
No Matches

◆ grow_map()

template<typename T>
void fl::deque< T >::grow_map ( fl::size extra_front,
fl::size extra_back )
inlineprivate

Definition at line 97 of file deque.h.

97 {
101 // Center the existing chunks within the new map, biased to leave the
102 // requested extra room on each side.
105 if (!new_map) {
106 // Allocation failure: match the silent-fail behavior of the prior
107 // vector-style ensure_capacity. Callers must defensively check
108 // capacity / size after push_*.
109 return;
110 }
111 // Free any chunk pointers in the OLD map that live outside the
112 // [mFrontMapIdx, mFrontMapIdx+used) live range; those are orphans
113 // and would otherwise leak when the old map is deallocated.
115 for (fl::size i = 0; i < mMapCapacity; ++i) {
118 mMap[i] = nullptr;
119 }
120 }
121 for (fl::size i = 0; i < used; ++i) {
123 }
125 mMap = new_map;
128 }
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
T ** allocate_map(fl::size capacity) FL_NO_EXCEPT
Definition deque.h:55
fl::size used_chunks() const FL_NO_EXCEPT
Definition deque.h:80
T ** mMap
Definition deque.h:38
fl::size mFrontMapIdx
Definition deque.h:40
FL_NO_INLINE fl::size deque_grow_map_capacity(fl::size current_map_capacity, fl::size min_required_chunks) FL_NO_EXCEPT

Referenced by fl::deque< int >::ensure_back_room(), fl::deque< int >::ensure_front_room(), and fl::deque< int >::reserve().

+ Here is the caller graph for this function: