lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Norbert Kiesel wrote:
> So running show.lua before default.lua is a bit faster for me than the
> other way around, but all are in the same ballpark (+- 3% or so)

Apparently it can only be triggered with a 32 bit Lua. And my
patch seems to solve the problem.

Maybe there's a less expensive place to put the GC check, though.
None of the parsed strings are collected, so it's really only
necessary to get the GC out of the sweepstring state. But the
reader function could interfere, so it's probably better to add
the check in luaX_newstring() as originally proposed.

BTW: I found another problem: luaX_setinput() calls next() which
in turn may call the reader function which in turn may run the GC.
But the chunkname string is still unanchored. It's only anchored
when open_func runs and anchors the prototype in the stack.

It looks like this can't trigger right now, because of the
lookahead check for the bytecode signature in f_parser. But it's a
potential GC bug, if that behavior ever changes.

--Mike