locks - incremented when you turn a JsVarRef into a JsVar*. After all the js*Kill functions are called, all of these should be 0, because nothing should 'have' a pointer any more.
references - incremented when you 'reference' one variable from another (eg. objects, names, etc).
When you do trace() you get those values written next to each variable.
And yes, when both hit 0 the variable is unallocated and added to the 'free list' of variables.
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.
Well, there should really be more info in http://www.espruino.com/Internals
There are 2 counters:
JsVarRef
into aJsVar*
. After all thejs*Kill
functions are called, all of these should be 0, because nothing should 'have' a pointer any more.When you do
trace()
you get those values written next to each variable.And yes, when both hit 0 the variable is unallocated and added to the 'free list' of variables.