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
931
of file
allocator.h
.
931
{
932
if
(!
p
||
n
== 0) {
933
return
;
934
}
935
936
// Check if this is inlined memory
937
T
*
inlined_start
=
get_inlined_ptr
();
938
T
*
inlined_end
=
inlined_start
+
N
;
939
940
if
(
p
>=
inlined_start
&&
p
<
inlined_end
) {
941
// This is inlined memory, mark slots as free
942
fl::size
slot_index
= (
p
-
inlined_start
);
943
for
(
fl::size
i
= 0;
i
<
n
; ++
i
) {
944
if
(
slot_index
+
i
<
N
) {
945
mFreeBits
.set(
slot_index
+
i
,
false
);
// Mark as free
946
}
947
}
948
mActiveAllocations
-=
n
;
949
return
;
950
}
951
952
// Fallback to base allocator for heap allocations
953
mBaseAllocator
.deallocate(
p
,
n
);
954
mActiveAllocations
-=
n
;
955
}
fl::allocator_inlined::mBaseAllocator
BaseAllocator mBaseAllocator
Definition
allocator.h:818
fl::allocator_inlined::mActiveAllocations
fl::size mActiveAllocations
Definition
allocator.h:821
fl::allocator_inlined::get_inlined_ptr
T * get_inlined_ptr() FL_NOEXCEPT
Definition
allocator.h:1001
fl::allocator_inlined::mFreeBits
fl::bitset_fixed< N > mFreeBits
Definition
allocator.h:820
fl::allocator_inlined
Definition
allocator.h:805
fl
allocator_inlined
Generated on Tue Jun 16 2026 00:07:04 for FastLED by
1.13.2