2 ms·
It would probably be OK if all programs have a simple, predictable sequence of malloc and free that they call in a loop, with similar-ish sizes each time. It's
by weland 11y ago
It would probably be OK if all programs have a simple, predictable sequence of malloc and free that they call in a loop, with similar-ish sizes each time.
It's extremely unpleasant to program something with just a few KB of RAM and not know exactly what memory goes where. However, a lot of IoT-related gadgets just gather a buffer of data from an ADC or something, average it and send it over some wireless protocol every 1 minute. The allocation pattern is predictable enough that you don't run into strange cornercases.
I see no reason why anyone would want to use this commercially, but for the enthusiast market (and maybe even for some rapid prototyping) this looks interesting enough.
- mwcampbell 11y agoIt seems to me that consistent allocation patterns would help more if JerryScript used reference counting for memory management, perhaps with mark-and-sweep GC as a backup to handle cycles. As it stands now, each object has a reference count to keep it alive while it's being used by C code via the API, but actual deallocation is done via mark-and-sweep GC.