Re:Lua in the Kernel?
by OskarS on Friday September 18, 2020 @04:56AM
(#24514510)
string.find is implemented in C, not Lua. As far as Lua is concerned, that call is a single instruction.
[ Parent
| on HN ]
You could have a string.find C implementation which gets an additional budget parameter and depending on it might limit search or similar (and reports back how much "budged" was used)
Through always under the assumption that the C function is implemented correctly and adding need to do some explicit budged keeping makes it more complex and in turn more prone to errors.
Re:Lua in the Kernel?
by DarkWiiPlayer on Friday September 18, 2020 @06:57AM
(#24515209)
A single instruction that can run for a long time. That's the point.