Re:QuickJS, the Next Generation: a mighty JavaScript engine
by not_a_dane on Monday July 08, 2024 @04:26AM
(#40903604)
when I see C/C++ code, I prefer do not run it.
Re:QuickJS, the Next Generation: a mighty JavaScript engine
by bun_terminator on Monday July 08, 2024 @05:01AM
(#40903797)
This is C, not C++ - very different languages.
Re:QuickJS, the Next Generation: a mighty JavaScript engine
by lionkor on Monday July 08, 2024 @09:43AM
(#40905371)
Yes, you should be using a goto for this in C
Re:QuickJS, the Next Generation: a mighty JavaScript engine
by metadat on Monday July 08, 2024 @10:32PM
(#40911999)
Line 52,000 and x of what file?
I didn't find any file with that many line's yet, still searching but I doubt it exists unless it's in a different repository.
Re:QuickJS, the Next Generation: a mighty JavaScript engine
by metadat on Tuesday July 09, 2024 @07:58PM
(#40922543)
Thanks for digging that up.
It looks like the mutex is theoretically sound.. unlocked before all returns, as long as there isn't an exception raised in between.
Re:QuickJS, the Next Generation: a mighty JavaScript engine
by lionkor on Wednesday July 10, 2024 @11:29AM
(#40928024)
Oh yeah of course its sound, but this is not how you write C code, because all it takes is for someone else in 10 years to, somewhere between 51000 and 53000 introduce an early return statement and forget to unlock that mutex, or other little things.
This is solved in C usually with a goto to a cleanup routine, and avoiding early returns.
Excellent job on building this, and it's very readable and nice, otherwise!