[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: New behaviour of lua_Alloc missing in list of API changes
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Thu, 7 Apr 2011 11:59:36 -0300
> 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