[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: PATCH: fixes bug with calling garbage collector from custom lua_Alloc
- From: "Robert G. Jakabosky" <bobby@...>
- Date: Sat, 3 May 2008 20:48:14 -0700
On Saturday 03, Louis Mamakos wrote:
> Do you need to worry about the memory allocator being invoked during a
> GC call, and recursively invoking lua_gc() again?
My new patch protects against calling luaC_fullgc() recursively. There might
still be a problem if a single GC step (with luaC_step) is happening and the
allocator tries to do a full GC.
> Is is possible that a _gc metamethod that might be invoked could
> allocate memory in the process of running the method and freeing
> up storage and causing a recursive invocation of lua_gc()?
I haven't tested the __gc metamethod yet, but as long as the luaC_step &
luaC_fullgc functions are protected from recursively call each other, there
shouldn't be a problem.
--
Robert G. Jakabosky