[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Why set useless stack slice(above L->top) to nil during gc atomic phase ?
- From: Roberto Ierusalimschy <roberto@...>
- Date: Tue, 10 May 2016 09:57:16 -0300
> Lua 5.2.4
> In lgc.c propagatemark -> traversestack, line 502-506,
> clear the slice in the range of [th->top + 1, th->stack + th->stacksize),
> What if don't clear not-marked stack slice ?
Sometimes Lua increates the stack pointer without filling the
corresponding slots (e.g., when entering a Lua funcion and then calling
a metamethod). This step ensures that the entire stack always has valid
values, so that later gc cycles can always traverse the stack without
problems.
-- Roberto