lua-users home
lua-l archive

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


> I can make a guess .. pushing an error message is going to require that you allocate heap space for that message.

That is why the error message for memory error is pre-allocated when the state
is created:
	http://www.lua.org/source/5.2/lstate.c.html#f_luaopen
	http://www.lua.org/source/5.2/lstate.c.html#MEMERRMSG

> We also use a custom allocator (for other reasons), but we reserve a block of heap storage at startup. If an allocation fails, we release that reserved memory to the heap and retry the allocation. 

Lua 5.2 implements a emergency gc that is run when memory allocation fails.