how to evalute the variable 'JSVAR_CACHE_SIZE' #4831
Replies: 1 comment
-
Posted at 2015-07-22 by @gfwilliams What kind of chip are you trying to target? You need room for the statically allocated variables that Espruino uses (buffers,etc) as well as for the stack. Generally 12k covers that. However on smaller chips, some things get left out and buffers get made smaller. I also tend to make the stack smaller as the assumption is on a smaller chip, with less RAM, you won't be doing as much recursion. All that means you can get away with less RAM being used. Also as soon as you get below 1023 variables, Espruino can use smaller addresses and can fit a JsVar into 12 bytes, not 16. Basically it's a bit of a balancing act. If you want to try and figure it out without doing anything very special, just keep making it bigger until it refuses to compile, then back off about 150 variables and see how it works. If you get errors when recursing then take a few more variables off, and so on. You've also got to think about the flash memory you'll need to store all the variables when you save them. At least now I've added compression it gets a bit easier though. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2015-07-22 by Long
I find that in nucleo411 board,
Why using RAM - 12 ? does it mean Espruino must run on ram more than 12K, So if I want to use Espruino in a board which has RAM less than 12K, do I have some solutions?
Beta Was this translation helpful? Give feedback.
All reactions