You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if ((var->flags&JSV_LOCK_MASK)!=JSV_LOCK_MASK) // if we hit the max amount of locks, don't exceed it (see https://github.com/espruino/Espruino/issues/2616)
/// Lock this pointer and return a pointer - UNSAFE for null pointer
833
833
JsVar*jsvLockAgain(JsVar*var) {
834
834
assert(var);
835
-
assert(jsvGetLocks(var) <JSV_LOCK_MAX);
836
-
var->flags+=JSV_LOCK_ONE;
835
+
if ((var->flags&JSV_LOCK_MASK)!=JSV_LOCK_MASK) // if we hit the max amount of locks, don't exceed it (see https://github.com/espruino/Espruino/issues/2616)
* it helps to explicitly save it to a var to avoid a
867
867
* load-store-load */
868
+
if ((var->flags&JSV_LOCK_MASK)==JSV_LOCK_MASK) return; // if we had the max number of locks, don't unlock as we probably didn't lock enough (see https://github.com/espruino/Espruino/issues/2616)
868
869
JsVarFlagsf=var->flags-=JSV_LOCK_ONE;
869
870
// Now see if we can properly free the data
870
871
// Note: we check locks first as they are already in a register
0 commit comments