[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Custom memory allocations
- From: madrenegade <madrenegade@...>
- Date: Wed, 28 Sep 2011 21:45:56 +0200
On 09/28/2011 09:43 PM, Peter Cawley wrote:
On Wed, Sep 28, 2011 at 8:38 PM, madrenegade<firstname.lastname@example.org> 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?