astronautlevel2 / Anemone3DS

A theme and boot splash manager for the Nintendo 3DS console
GNU General Public License v3.0
908 stars 44 forks source link

Memory leak fix and camera multithreading safety improvement #239

Closed LiquidFenrir closed 3 years ago

LiquidFenrir commented 3 years ago

The leak was in the smdh loading code for the original entry load, to get the author/desc/name. it never freed the buffer. since the smdh is already loaded before even creating the entry, you can just remove that previous step and reuse the check buffer to load the entry info directly, just requires moving the free a bit. That should allow a lot more entries to be loaded (some poor lad had only 2021 themes make anemone crash, when the limit should be much higher)

Camera syncing was weird for a while, many users had the scanner never work. Tried making it cleaner with a Multiple Reader Single Writer algorithm from wikipedia, neither the ui or the scan can mess up with the camera's write now, and it's just as fast if not faster (some benchmarks done on TP discord) than current implementation. It's mostly the same guts, just reordered.