FastLED 3.9.15
Loading...
Searching...
No Matches

◆ allocate()

template<typename T>
T * fl::allocator_realloc< T >::allocate ( fl::size n)
inline

Definition at line 306 of file allocator.h.

306 {
307 if (n == 0) {
308 return nullptr;
309 }
310 fl::size size = sizeof(T) * n;
311 void *ptr = Malloc(size);
312 if (ptr == nullptr) {
313 return nullptr;
314 }
315 fl::memset(ptr, 0, sizeof(T) * n);
316 return static_cast<T*>(ptr);
317 }
void * memset(void *s, int c, size_t n) FL_NOEXCEPT
void * Malloc(fl::size size)

Referenced by fl::allocator_realloc< U >::allocate_at_least().

+ Here is the caller graph for this function: