lua-users home
lua-l archive

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


Recap: With a lot of userdata objects I got a stall in atomic(L). I switched them over to tables which got rid of the stall. But now I've realized that I need some of them (ten thousand or so) to have finalizers and then I am back to the stall in atomic (because only userdata can have finalizers).

My current plan is to see if the finalizer code in Lua can somehow be simplified. It seems like Lua spends a lot of effort making sure that finalizers are called in the right order and at the end of the garbage collection cycle. I don't actually need that. 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() by rewriting the way the garbage collector handles unit data, but I'm a bit wary of touching the lua GC code.

Has anyone done something like this? Or have any ideas on where to start?

// Niklas