[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: A Problem about lua-5.2.0's code
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Fri, 13 Jan 2012 10:56:33 -0200
> 642| setptvalue2s(L, L->top, tf);
> 643| incr_top(L);
> 644| cl = luaF_newLclosure(L, tf);
> 645| setclLvalue(L, L->top - 1, cl);
> It seems that the code in line 642 is useless. Because the stack entry will be cover by the code in line 645.
> Is it really useless or it has other effect?
It serves to anchor tf to avoid it being collected if a collection is
triggered inside luaF_newLclosure. (Functions that allocate memory can
trigger collections.)