[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: help to (slightly) modify Lua interpreter
- From: Roberto Ierusalimschy <roberto@...>
- Date: Sat, 7 Nov 2009 22:04:17 -0200
> > I guess the next code gives a reasonable solution for 2D arrays.
> > (It should not be too dificult to generalize it to n dimensions.)
> > [...]
> Every time m[i][j] is called two new closures are created to be used
> only once. Would it drive GC crazy if m[i][j] is used withing loops
> millions of times??
Maybe there is something wrong in my code, but I think it memorizes
accesses to m[i]. So, the first time m[i] is accessed Lua creates two new
closures (plus one table), but after that, the following accesses do not
create anything (until the next collection).