lua-users home
lua-l archive

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


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