Yes - flat strings are used for Typed Arrays, and store data with just a single 16 byte var at the start as overhead. They take a bit longer to allocate though as Espruino has to search through to find a contiguous block of variables - and you can't guarantee that it will.
There's an issue open for using them to store function code - but we probably don't want to do it when we're creating functions inside functions as that might be too slow.
I'd really like to avoid 're-packing' the data that's in RAM if at all possible - it just sounds like a recipe for disaster.
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.
Yes - flat strings are used for Typed Arrays, and store data with just a single 16 byte var at the start as overhead. They take a bit longer to allocate though as Espruino has to search through to find a contiguous block of variables - and you can't guarantee that it will.
There's an issue open for using them to store function code - but we probably don't want to do it when we're creating functions inside functions as that might be too slow.
I'd really like to avoid 're-packing' the data that's in RAM if at all possible - it just sounds like a recipe for disaster.