9#include "esp_heap_caps.h"
10#include "esp_system.h"
13FASTLED_NAMESPACE_BEGIN
19void *DefaultAlloc(
size_t size) {
20 void *out = heap_caps_malloc(size, MALLOC_CAP_SPIRAM);
23 out = heap_caps_malloc(size, MALLOC_CAP_DEFAULT);
27void DefaultFree(
void *ptr) { heap_caps_free(ptr); }
29void *DefaultAlloc(
size_t size) {
return malloc(size); }
30void DefaultFree(
void *ptr) { free(ptr); }
33void *(*Alloc)(size_t) = DefaultAlloc;
34void (*Free)(
void *) = DefaultFree;
37void SetLargeBlockAllocator(
void *(*alloc)(
size_t),
void (*free)(
void *)) {
42void* LargeBlockAllocate(
size_t size,
bool zero) {
43 void* ptr = Alloc(size);
50void LargeBlockDeallocate(
void* ptr) {