[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Preventing garbage collection of entities
- From: Sergey Zakharchenko <doublef.mobile@...>
- Date: Wed, 5 Dec 2018 07:33:51 +0000
> Ah, I see - it’s to exclude them from the mark and sweep. Have you tried doing it from C to see what the savings would be in a true use-case?
It doesn't make sense for me to try if the functionality is
deliberately hidden and may go away any time, which is what my
question is largely about.
> Have a bit trouble seeing how that would work, as the dependencies still would need to be marked? Or should those be made non-GC on assignment? That could get tricky if multiple entities can reference them?
Correct, the set of entities that could be stored that way would be
quite restricted (nested tables, functions without upvalues, or make
the first upvalue somehow 'not count' as a non-GC reference in Lua
5.2+, probably other pitfalls) but it could still be useful. It's
really complicated to expose that to Lua code but could be doable from
the C API...