There should be 93 blocks of stack remaining 93 == 1488 / 16 bytes per JsVar
String strr isn't created as it appears to run into/off the end of the stack.
So, either; using process.memory().free to determine what memory is available isn't the best way or doesn't determine correctly the actual memory (unlikely as it's been around for some time) available or
the way in which flat string memory is allocated needs to be re-visited perhaps?
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Wed 2019.01.30
Now peppered with the actual address as seen by allocation:
stackEndAddress: 536958216 - actual strg: 536955892 = 2324
Free: 1375 - 1361 = 14 14 blocks * 16 = 224 bytes used
strg: 536955892 - strd: 536954404 = 1488
There should be 93 blocks of stack remaining 93 == 1488 / 16 bytes per JsVar
String strr isn't created as it appears to run into/off the end of the stack.
So, either; using
process.memory().free
to determine what memory is available isn't the best way or doesn't determine correctly the actual memory (unlikely as it's been around for some time) available orthe way in which flat string memory is allocated needs to be re-visited perhaps?