Is automatic memory management (acquire/release) done with just reference counting?
No... There's reference counting to free 99% of variables right away, but then it does a mark/sweep when idle or if it can't allocate any memory.
Ok, it's definitely an issue with references - see the r255 on the prototype here:
#54[r1,l2] Name String [1 blocks] "httpCRq" #55[r2,l1] NativeFunction 0x426706 (1) {
#56[r1,l2] Name String [2 blocks] "prototype" #58[r255,l1] Object {
#59[r1,l2] Name String [2 blocks] "constructor" #55[r2,l2] ...
}
}
It's being referenced a lot, but not unreferenced.
Looks like this could be a big issue with garbage collection, that when it frees things it isn't unreffing what they point to! I'll try and come up with some code to break it :)
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.
No... There's reference counting to free 99% of variables right away, but then it does a mark/sweep when idle or if it can't allocate any memory.
Ok, it's definitely an issue with references - see the r255 on the prototype here:
It's being referenced a lot, but not unreferenced.
Looks like this could be a big issue with garbage collection, that when it frees things it isn't unreffing what they point to! I'll try and come up with some code to break it :)