• Q: Does Espruino make an entire copy of the class functions (and called functions) when creating an instance using a constructor?

    No, it links to it - and E.getSizeOf follows those links. To get the size of just the instance, subtract the E.getSizeOf of the class.

    Q: For clarification, a Uint is saved as ?? 16 byte JsVar e.g. Uint8ClampedArray(10) == ?? 16 byte JsVars?

    A Uint uses one 16 byte JsVar unless it's in a typed array, when it'll use whatever the size of that array is. Uint8ClampedArray(10) will take 3 JsVars (i think?), but then the data is stored after it... So Uint8ClampedArray(10) probably takes 4 (so using just one JsVar for data).

About

Avatar for Gordon @Gordon started