Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update AnimatedGIFs sketch for ESP32 to use malloc and avoid compile/startup issues with large buffers #69

Open
embedded-creations opened this issue Mar 10, 2019 · 8 comments

Comments

@embedded-creations
Copy link
Contributor

pixelmatix/AnimatedGIFs#26

@marcmerlin
Copy link
Contributor

if anyone needs this it's in my fork: https://github.com/marcmerlin/AnimatedGIFs

@embedded-creations
Copy link
Contributor Author

I'm not sure where this stands after updating GifDecoder to use the AnimatedGIF library, so I'm going to close it

@marcmerlin
Copy link
Contributor

if it still uses arrays instead of mallocs, the problem isn't fixed.
arrays get alloced early in a smaller pool in ESP32, and just don't fit on a decent size display, but they fit if you use malloc because that goes into another pool (yeah, ESP32 sucks in that way)

@embedded-creations
Copy link
Contributor Author

OK, thanks for the clarification, I'll reopen it.

@embedded-creations
Copy link
Contributor Author

I think this shows how to allocate the block needed for AnimatedGIF with malloc (after allocating mymemorypool with malloc):

bitbank2/AnimatedGIF#8 (comment)

@marcmerlin
Copy link
Contributor

marcmerlin commented Nov 27, 2020

I'm only seeing the use of a single static array. If so, that is not as good as malloc as ESP32 has memory available at runtime with malloc but not available in pre-allocated buffers (global arrays).
Also, to use psram if you choose to, you have to use malloc.

This is what I did to my old fork of the library, I switched everything to malloc.
Sorry, this is not a single CL, I wrote it over time

I later updated mallocordie to allow allocating in PSRAM to further save main memory

@marcmerlin
Copy link
Contributor

@embedded-creations
Copy link
Contributor Author

Thanks for the links, I'm not working on this now, but they look useful for later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants