[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Creating closures (or not)
- From: Roberto Ierusalimschy <roberto@...>
- Date: Tue, 13 Jul 2010 09:04:35 -0300
> My guess is that they would only be pooled if they share the same prototype,
> and do not use any upvalues, such as:
>
> t = {}
> for i = 1, 10 do
> t[i] = function() end
> end
They may be reused even with upvalues, as long as they have the same
upvalues; each prototype caches the last closure created with it.
-- Roberto