lua-users home
lua-l archive

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


My current plan is to see if the finalizer code in Lua can somehow be simplified.
>> [...]
My finalizers can be called in any order and at any time during garbage collection, before the userdata object is freed.

I'm thinking (hoping) that with these less strict requirements it would be possible to get rid of the stall in atomic()

I am not sure this will help. I guess that what causes the stall is
not that the handling of each userdata is complex, but that all those
10,000 userdata must be handled atomically. (The key function here
is 'luaC_separateudata'.) I think the solution would be to do that
separation phase incrementally too, but I don't know how to do it.

Yes, it is luaC_separateudate that stalls. But is that separation phase really needed if my finalizers "promise" never to create new lua objects, touch other lua objects, etc.

Couldn't I just call the finalizer in freeobj()?

(My understanding of Lua's garbage collector is still a bit sketchy.)

// Niklas