lua-users home
lua-l archive

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


> What really should happen is that there should be an API function which
> allows a memory cap to be set, something like
> 
> lua_setmaxmemory(L,8388608);
> 
> Setting a memory cap is such a common thing to do that it really should be
> trivial to do it.  Not that writing a custom allocator is a huge deal but it
> does require some development/testing effort that would be better spent
> elsewhere.

Just adapt the one in lauxlib.c:
	http://www.lua.org/source/5.1/lauxlib.c.html#l_alloc