[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: __gc & error and GC & local weirdness
- From: Roberto Ierusalimschy <roberto@...>
- Date: Thu, 4 Aug 2016 18:41:38 -0300
> Another weird thing happens when changing
>
> -- begin diff to testcase #2 --
> 4c4
> < while true do trace '.' ; t = { } end
> ---
> > while true do trace '.' ; local t = { } end
> -- end diff to testcase #2 --
>
> (or alternatively saying `local t` in 'body' before entering the loop.)
>
> Now I get (with and without HARDMEMTESTS, even when adding an additional
> explicit `collectgarbage "collect"` in the loop)
>
> AB........(forever)
>
> i.e. the GC doesn't run while Lua merrily allocates gigabytes of memory.
I didn't see any problem here. The __gc does not run because 't' is not
garbage. The GC seems to run, as (at least on my machine) the program
does not allocate gigabytes of memory. (It does seem to allocate very
little memory, in fact.)
-- Roberto