[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: question: lua deterministic gc
- From: Andrew Gierth <andrew@...>
- Date: Sun, 27 Dec 2020 01:08:42 +0000
>>>>> "Dibyendu" == Dibyendu Majumdar <firstname.lastname@example.org> writes:
>> Calling 'collectgarbage' twice frees all memory not in use by Lua.
Dibyendu> Why twice?
As I understand it, after the first call, unreferenced objects with
finalizers have had the finalizer called, but the object itself is not
freed until the next GC pass (since it had to be revived in order to
run the finalizer, and it's not known if the finalizer stored any
reference to it until we do another full mark/sweep cycle).
Dibyendu> Also is this true of both incremental / generational modes,
Dibyendu> as well as of Lua 5.3?