• Well, there should really be more info in http://www.espruino.com/Internals

    There are 2 counters:

    • 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.

About

Avatar for Gordon @Gordon started