40 if (
result && new_bytes > old_bytes) {
42 fl::memset(
static_cast<char*
>(
result) + old_bytes, 0, new_bytes - old_bytes);
48 return this == &other;
67 return this == &other;
74 static DefaultMemoryResource instance;
79 static PSRamMemoryResource instance;
void * do_allocate(fl::size bytes) FL_NO_EXCEPT override
bool do_is_equal(const memory_resource &other) const FL_NO_EXCEPT override
void do_deallocate(void *p, fl::size bytes) FL_NO_EXCEPT override
void * do_reallocate(void *p, fl::size old_bytes, fl::size new_bytes) FL_NO_EXCEPT override
Default: returns nullptr (not supported). Override for realloc-capable resources.
void * do_allocate(fl::size bytes) FL_NO_EXCEPT override
bool do_is_equal(const memory_resource &other) const FL_NO_EXCEPT override
void do_deallocate(void *p, fl::size bytes) FL_NO_EXCEPT override
virtual void * do_reallocate(void *p, fl::size old_bytes, fl::size new_bytes) FL_NO_EXCEPT
Default: returns nullptr (not supported). Override for realloc-capable resources.
Polymorphic memory resource base class (PMR-style).
#define FASTLED_UNUSED(x)
PMR-style polymorphic memory resource for type-erased allocation.
u8 u8 fract8 blur_amount FL_NO_EXCEPT
void Free(void *ptr) FL_NO_EXCEPT
FASTLED_FORCE_INLINE void * memset(void *s, int c, size_t n) FL_NO_EXCEPT
memory_resource * default_memory_resource() FL_NO_EXCEPT
Get the default memory resource (wraps fl::Malloc / fl::Free / fl::realloc).
memory_resource * psram_memory_resource() FL_NO_EXCEPT
Get the PSRAM memory resource (wraps PSRamAllocate / PSRamDeallocate).
expected< T, E > result
Alias for expected (Rust-style naming)
void * PSRamAllocate(fl::size size, bool zero) FL_NO_EXCEPT
FASTLED_FORCE_INLINE void * realloc(void *ptr, size_t new_size) FL_NO_EXCEPT
void * Malloc(fl::size size) FL_NO_EXCEPT
void PSRamDeallocate(void *ptr) FL_NO_EXCEPT
Base definition for an LED controller.