[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] LuaFileSystem 1.8.0
- From: Hugo Musso Gualandi <hgualandi@...>
- Date: Thu, 23 Apr 2020 23:03:18 -0300
Em qui, 2020-04-23 às 22:14 +0100, Dibyendu Majumdar escreveu:
> On Thu, 23 Apr 2020 at 02:30, Hisham <h@hisham.hm> wrote:
> > For example, with `uname -n` set below 10000, this script crashes
> > on
> > Lua < 5.4, and works in Lua 5.4:
> >
> > local lfs = require("lfs")
> > for t = 1, 10000 do
> > local i = 0
> > for e in lfs.dir("/usr/lib") do
> > i = i + 1
> > if i == 100 then
> > break
> > end
> > end
> > end
> >
>
> Out of interest, how would you have written this in older versions of
> Lua?
IIRC, the most most direct workaround was to manually call
collectgarbage in order to run the iterator's __gc metamethod. The
performance is not ideal though.
-- Hugo
_______________________________________________
lua-l mailing list -- lua-l@lists.lua.org
To unsubscribe send an email to lua-l-leave@lists.lua.org