lua-users home
lua-l archive

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


 What in earth would be the point of a garbage collected garbage collector?
It sounds like bad design to me, accomplishes nothing but complicate the system.

On 2010-10-12 22:11, Martin Voigt wrote:
Do you mean using Boehm gc together with or instead of Lua's gc?
We're passing our memory allocator to lua_newstate, which means that
Lua still uses it's gc behaviour, but all real memory allocation is
controlled by our gc (since malloc, realloc, free and the like are
passed to it). On paper it is safe, as long as the memory
(de)allocation functions implement their contract (which they do). It
would only break if Lua's memory management would a) store pointers to
"supposed to be freed" memory without actually freeing it (it
doesn't); or b) it's behaviour is modelled with certain assumptions
about the gc algorithm. It seems b) is also not the case by looking at
the source, but I just wanted to ask, devil in the detail and that.

bw,
Martin