• Normal JsVarRefs for most boards are 16 bits, so can store up to 65535 variables. But the Resizable vars build can do 4 billion because of 32 bit references (I believe). But adding 32 bit references really pushes the size of a JsVar up, so you don't want to do that.

    Basically, what you've done is fine - although ultimately I guess you'll want to set jsVarsSize to something else before calling jsvInit?

    I would do this instead in the second bit though - no point hard-coding numbers where it's not needed:

    #ifdef ESP32
    jsVarsSize = 2100;
    jsVars = (JsVar *)malloc(sizeof(JsVar)*jsVarsSize);
    #endif

About

Avatar for Gordon @Gordon started