lua-users home
lua-l archive

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


Its a diff. The lines starting with > are additions; < is a removal. Easiest solution would be to use an implementation of the POSIX patch utility

On 27 Sep 2012 17:53, "John Dunn" <John_Dunn@qscaudio.com> wrote:
> Lua does check the collector when it creates error messages, and so the collector does not get a chance to run.
> The error causes Lua to skip that check, too. Replacing that check solves both problems:
>
> *** ldo.c:
> 313a314
> >       luaC_checkGC(L);  /* stack grow uses memory */
> 340a342
> >       luaC_checkGC(L);  /* stack grow uses memory */
> 396d397
> <   luaC_checkGC(L);

Are you saying that I can modify ldo.c to address the issue? I only see one call to luaC_check(L) which is on line 396 in luaD_call. What exactly should I change?

Right now I'm just calling lua_gc(L, LUA_GCCOLLECT, 0) any time lua_pcall() returns an error. While probably horribly inefficient it does appear to address my issue.