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
653
T
*
inlined_start
=
get_inlined_ptr
();
654
T
*
inlined_end
=
inlined_start
+
N
;
655
656
if
(
p
>=
inlined_start
&&
p
<
inlined_end
) {
657
// This is inlined memory, mark slots as free
658
fl::size
slot_index
= (
p
-
inlined_start
);
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
}
664
m_active_allocations
-=
n
;
665
return
;
666
}
667
668
669
670
// Fallback to base allocator for heap allocations
671
m_base_allocator
.deallocate(
p
,
n
);
672
m_active_allocations
-=
n
;
673
}
fl::allocator_inlined::m_base_allocator
BaseAllocator m_base_allocator
Definition
allocator.h:534
fl::allocator_inlined::get_inlined_ptr
T * get_inlined_ptr()
Definition
allocator.h:719
fl::allocator_inlined::m_free_bits
fl::bitset_fixed< N > m_free_bits
Definition
allocator.h:536
fl::allocator_inlined::m_active_allocations
fl::size m_active_allocations
Definition
allocator.h:537
fl::allocator_inlined
Definition
allocator.h:521
fl
allocator_inlined
Generated on Fri Aug 22 2025 20:59:36 for FastLED by
1.13.2