Closed AliceGrey closed 4 years ago
Good catch! This logic was originally to check if resources "looked" corrupt on flash, but this makes it even more precise. Another way to do this would be by just letting the malloc() fail, rather than reaching into the allocator, but this is more explicit, to be sure. I left a few comments.
Made changes based on comments. We now return if the check fails and removed the debug logging I accidentally left in there.
LGTM! Thanks!
Removed 200K hard limit for resources. Should be checking the size of available heap and comparing it to the resource size.