[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: sizeof function closures in lua 5.1?
- From: Jim Pryor <lists+lua@...>
- Date: Mon, 7 Sep 2009 09:37:41 -0400
I should note I'm using a 64-bit Linux kernel. That may affect some of the sizes. (Perhaps that's why I'm seeing functions as 40 bytes overhead rather than 20 bytes.)
Also I notice this comment in the discussion on that WoW wiki page, in case it helps:
> Description of upvalues is a bit flawed
> Just a note, the way upvalue memory use is described is somewhat flawed, as
> it's not separating the memory for the upvalue reference (4 bytes per closure)
> from the memory for the value (28 bytes, IIRC). Lua doesn't care if the upvalue
> changes or not (contrary to the wording here), the difference is that in the
> 'constant' case there's only one VALUE and a reference in each closure, but in
> the 'variable' example, there's a value for each instance, plus the 4 bytes on
> each closure.
But I still need someone to talk me through what's going on here...?
--
Jim Pryor
jim@jimpryor.net