lua-users home
lua-l archive

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

> 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.