Skip to content

Commit 22ead30

Browse files
committed
Unlock functionCode early in function execution to reduce locks needed during recursion (#2616)
1 parent 1fc6cc8 commit 22ead30

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
Bangle.js: Added 'bpmMin/bpmMax' and 'activity' to 'health' event and 'Bangle.getHealthStatus'
2525
Fix potential overflow of locks - favour small memory leak over accidental free if this ever happens (fix #2616)
2626
micro:bit2: Ensure we don't initialise the I2C1 peripheral (we use software I2C internally)
27+
Unlock functionCode early in function execution to reduce locks needed during recursion (#2616)
2728

2829
2v25 : ESP32C3: Get analogRead working correctly
2930
Graphics: Adjust image alignment when rotating images to avoid cropping (fix #2535)

src/jsparse.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -839,6 +839,8 @@ NO_INLINE JsVar *jspeFunctionCall(JsVar *function, JsVar *functionName, JsVar *t
839839
JsLex newLex;
840840
JsLex *oldLex = jslSetLex(&newLex);
841841
jslInit(functionCode);
842+
jsvUnLock(functionCode); // unlock function code here to reduce amount of locks needed during recursion
843+
functionCode = 0;
842844
#ifndef ESPR_NO_LINE_NUMBERS
843845
newLex.lineNumberOffset = functionLineNumber;
844846
#endif

0 commit comments

Comments
 (0)