FastLED 3.10.6
Loading...
Searching...
No Matches

◆ allocate()

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

Definition at line 307 of file allocator.h.

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

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

+ Here is the caller graph for this function: