lua-users home
lua-l archive

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

> > After a little investigation into what may occupy memory, I found that
> > debug.sethook() leaves some internal data in the registry despite the
> > corresponding coroutines have been collected. LuaJIT manages to free
> > them as it probably should.
> It is true. (Well, being more precise, the coroutines themselves are
> never collected, because they are locked in the hook table.)  Lua 5.2
> has the same problem. It seems that the hook table should have weak
> keys.

My "more precise" was wrong :) Lua does not use the coroutine itself
as the key, but the coroutine address (as a light userdata).

-- Roberto