WLED icon indicating copy to clipboard operation
WLED copied to clipboard

improve image_loader memory management by using WLED internal d_malloc() / p_malloc()

Open softhack007 opened this issue 3 months ago • 0 comments

during engineering of #5040, we found that memory management in the gif loader could be improved, however this would need changes in the GifDecoder library.

  • create a PR for Aircoookie/GifDecoder:

    1. add return value to decoder.alloc(), for platforms that do not support exceptions. true=success, false=failed
    2. support a custom "malloc" callback function. This function gets the number of bytes as parameter, and it returns a pointer to the allocated memory. decoder.alloc() then constructs its internal "gif" object inside the provided memory block.
  • once we have support in GifDecoder, integrate WLED internal d_malloc() into image_loader.cpp.

softhack007 avatar Nov 14 '25 13:11 softhack007