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

◆ reallocate()

void * fl::memory_resource::reallocate ( void * p,
fl::size old_bytes,
fl::size new_bytes )
inline

Try to resize in-place.

Returns new pointer on success, nullptr on failure. On failure, caller must allocate-copy-deallocate manually.

Definition at line 32 of file memory_resource.h.

32 {
33 if (new_bytes == 0) {
34 deallocate(p, old_bytes);
35 return nullptr;
36 }
37 if (!p) return allocate(new_bytes);
38 return do_reallocate(p, old_bytes, new_bytes);
39 }
void deallocate(void *p, fl::size bytes) FL_NOEXCEPT
virtual void * do_reallocate(void *p, fl::size old_bytes, fl::size new_bytes) FL_NOEXCEPT
Default: returns nullptr (not supported). Override for realloc-capable resources.
void * allocate(fl::size bytes) FL_NOEXCEPT

References allocate(), deallocate(), do_reallocate(), and FL_NOEXCEPT.

+ Here is the call graph for this function: