Closed dstroy0 closed 2 years ago
You could also use the arduino/report-size-deltas action to compute mem usage and output it in a PR comment, but I think that would be more applicable for a stable state of the lib.
This is an extension of some of the computing that happens in addcommand. What I want is a per command estimate so that we can abort early if there's not enough memory instead of allocating some and then immediately have to cleanup.
It will be precomputed so comparison will be fast.
Speaking of precomputing and compute once. There are quite a few areas that need that now in the branch I've been working on so I'm going to open an issue for that.
That's what this is about mostly, getting the estimate for a performance increase but displaying it to assist users in planning as well.
What I want is a per command estimate so that we can abort early if there's not enough memory instead of allocating some and then immediately have to cleanup.
This sounds like a job for malloc()
I'm already checking for nullptr at individiual alloc steps, I'm just wondering if I can precompute the size so I only have to check for nullptr once, but I don't know how safe that is?
I think this is resolved
estimate ram use by adding up the different buffers that could be used, report scope timeline of them, etc. Just more helpful information for debugging advanced implementations.