[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Odd looking code in lmem.c
- From: Tom N Harris <telliamed@...>
- Date: Thu, 26 Jun 2014 18:57:38 -0400
On Thursday, June 26, 2014 01:16:57 AM Paige DePol wrote:
> In vanilla Lua, it does not appear so, you would have to modify the
> `luaM_realloc_` function to add such functionality yourself. I also run the
> GC in steps for my game engine so this is something I need to consider as
> well.
I was going to say something about a user-defined allocator, but the custom
function doesn't have access to the Lua state, does it? That's too bad. I
guess you could make the allocator userdata be a lua_State** and copy the
state pointer into it after it's created. The pointer would be invalid when
creating the state itself, of course.
--
tom <telliamed@whoopdedo.org>