lua-users home
lua-l archive

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

On 09/28/2011 09:43 PM, Peter Cawley wrote:
On Wed, Sep 28, 2011 at 8:38 PM, madrenegade<>  wrote:
I am using Lua in my game engine and want to use my own memory allocator.
The problem is that Lua seems to call the allocation function with pointers
that are not managed by my own memory manager.
Are you setting the allocator at state creation time with lua_newstate
or at some point later with lua_setallocf? If the latter, then any
allocations done with the previous allocator will become the
responsibility of the new allocator.

lua_setallocf is the first thing i do after calling lua_open. Maybe this is the problem.
Why are there lua_open and lua_newstate?