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

◆ deallocate()

template<typename T, fl::size N, typename BaseAllocator = fl::allocator<T>>
void fl::allocator_inlined< T, N, BaseAllocator >::deallocate ( T * p,
fl::size n )
inline

Definition at line 647 of file allocator.h.

647 {
648 if (!p || n == 0) {
649 return;
650 }
651
652 // Check if this is inlined memory
655
656 if (p >= inlined_start && p < inlined_end) {
657 // This is inlined memory, mark slots as free
659 for (fl::size i = 0; i < n; ++i) {
660 if (slot_index + i < N) {
661 m_free_bits.set(slot_index + i, false); // Mark as free
662 }
663 }
665 return;
666 }
667
668
669
670 // Fallback to base allocator for heap allocations
671 m_base_allocator.deallocate(p, n);
673 }
BaseAllocator m_base_allocator
Definition allocator.h:534
fl::bitset_fixed< N > m_free_bits
Definition allocator.h:536
fl::size m_active_allocations
Definition allocator.h:537