FastLED
3.9.15
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
344
of file
allocator.h
.
344
{
345
if
(
n
== 0) {
346
return
{
nullptr
, 0};
347
}
348
// Ask for 1.5x to reduce future reallocations
349
fl::size
requested
= (3 *
n
) / 2;
350
T
*
ptr
=
allocate
(
requested
);
351
if
(
ptr
) {
352
return
{
ptr
,
requested
};
353
}
354
// Fallback: try exact size if 1.5x failed
355
ptr
=
allocate
(
n
);
356
return
{
ptr
,
ptr
?
n
: 0};
357
}
fl::allocator_realloc::allocate
T * allocate(fl::size n) FL_NOEXCEPT
Definition
allocator.h:306
fl::allocator_realloc
Definition
allocator.h:270
fl
allocator_realloc
Generated on Tue Jun 16 2026 00:07:04 for FastLED by
1.13.2