FastLED
3.10.6
Loading...
Searching...
No Matches
◆
allocate_at_least()
template<typename T>
allocation_result
<
pointer
,
size_type
>
fl::allocator_realloc
< T >::allocate_at_least
(
fl::size
n
)
inline
Definition at line
345
of file
allocator.h
.
345
{
346
if
(
n
== 0) {
347
return
{
nullptr
, 0};
348
}
349
// Ask for 1.5x to reduce future reallocations
350
fl::size
requested
= (3 *
n
) / 2;
351
T
*
ptr
=
allocate
(
requested
);
352
if
(
ptr
) {
353
return
{
ptr
,
requested
};
354
}
355
// Fallback: try exact size if 1.5x failed
356
ptr
=
allocate
(
n
);
357
return
{
ptr
,
ptr
?
n
: 0};
358
}
fl::allocator_realloc::allocate
T * allocate(fl::size n) FL_NO_EXCEPT
Definition
allocator.h:307
fl::allocator_realloc
Definition
allocator.h:271
fl
allocator_realloc
Generated on Sun Oct 4 2026 23:09:08 for FastLED by
1.13.2