FastLED
3.10.6
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
945
of file
allocator.h
.
945
{
946
if
(!
p
||
n
== 0) {
947
return
;
948
}
949
950
// Check if this is inlined memory
951
T
*
inlined_start
=
get_inlined_ptr
();
952
T
*
inlined_end
=
inlined_start
+
N
;
953
954
if
(
p
>=
inlined_start
&&
p
<
inlined_end
) {
955
// This is inlined memory, mark slots as free
956
fl::size
slot_index
= (
p
-
inlined_start
);
957
for
(
fl::size
i
= 0;
i
<
n
; ++
i
) {
958
if
(
slot_index
+
i
<
N
) {
959
mFreeBits
.set(
slot_index
+
i
,
false
);
// Mark as free
960
}
961
}
962
mActiveAllocations
-=
n
;
963
return
;
964
}
965
966
// Fallback to base allocator for heap allocations
967
mBaseAllocator
.deallocate(
p
,
n
);
968
mActiveAllocations
-=
n
;
969
}
fl::allocator_inlined::mBaseAllocator
BaseAllocator mBaseAllocator
Definition
allocator.h:832
fl::allocator_inlined::mActiveAllocations
fl::size mActiveAllocations
Definition
allocator.h:835
fl::allocator_inlined::get_inlined_ptr
T * get_inlined_ptr() FL_NO_EXCEPT
Definition
allocator.h:1015
fl::allocator_inlined::mFreeBits
fl::bitset_fixed< N > mFreeBits
Definition
allocator.h:834
fl::allocator_inlined
Definition
allocator.h:819
fl
allocator_inlined
Generated on Sun Oct 4 2026 23:09:08 for FastLED by
1.13.2