Re: cost of closure?
2007-05-31 23:08:23 GMT
On 5/31/07, YC <yinso.chen@...> wrote: > Am I inferring correctly that you are saying closure consumes a constant > factor of memory over struct, but otherwise doesn't necessarily hold onto > unnecessarily references from the stack? Right. > Any other way besides closure & struct to create opaque compound value > objects? The way we think of it: all compound values are structs at one level or another. You just may or may not have access to the inspector to see the fields. So ... no. :) > Thanks, > yinso > > > On 5/31/07, Robby Findler <robby@...> wrote: > > The size of a closure is proportional to the number of free variables > > in the function. A struct with an equivalent number of slots uses less > > memory, however. > > > > Robby > > > > On 5/31/07, YC < yinso.chen@...> wrote: > > > > > > On 5/31/07, Carl Eastlund <cce@...> wrote: > > > > > In principle, a closure is essentially a struct. All that needs to > be(Continue reading)