Is there a way to find out if created flat or 'fallen back to be fragmented'?
You can check manually with trace(var)
I assume that a compact is not possible because of chosen memory architecture
It is possible, and it would be pretty easy to create an 'old->new' mapping on the stack and use that to re-map everything (as long as you left the 'locked' variables alone). It just hasn't been done yet because I don't have as much time as I'd like :) I have to focus what time I have on the enhancements and fixes that matter to most people, and I don't think that the fragmentation will actually be a big issue in most use cases.
It's also important to note that the thing that might fail (native functions) will tend to allocate quite small flat strings - which is extremely unlikely to fail even when the memory is very fragmented.
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.
You can check manually with
trace(var)
It is possible, and it would be pretty easy to create an 'old->new' mapping on the stack and use that to re-map everything (as long as you left the 'locked' variables alone). It just hasn't been done yet because I don't have as much time as I'd like :) I have to focus what time I have on the enhancements and fixes that matter to most people, and I don't think that the fragmentation will actually be a big issue in most use cases.
It's also important to note that the thing that might fail (native functions) will tend to allocate quite small flat strings - which is extremely unlikely to fail even when the memory is very fragmented.