lua-users home
lua-l archive

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


Exactly what I was looking for, thank you!

I'm just starting with Lua embedding, but what use does lua_setallocf have? It seems extremely dangerous in general due to the potential allocator mismatch issue.


--- On Sat, 9/27/08, Alex Davies <alex.mania@iinet.net.au> wrote:

> From: Alex Davies <alex.mania@iinet.net.au>
> Subject: Re: lua_setallocf question
> To: "Lua list" <lua@bazar2.conectiva.com.br>
> Date: Saturday, September 27, 2008, 11:24 AM
> >    lua_State* state = luaL_newstate();
> >    lua_setallocf(state,
> &CustomAllocator::lua_Alloc, &alloc);
> >    lua_close(state);
> 
> luaL_newstate is from the aux library, use lua_newstate()
> instead.
> 
> - Alex