[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: sizeof function closures in lua 5.1?
- From: Jim Whitehead II <jnwhiteh@...>
- Date: Mon, 7 Sep 2009 14:43:10 +0100
On Mon, Sep 7, 2009 at 2:37 PM, Jim Pryor<lists+lua@jimpryor.net> wrote:
> 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:
Keep in mind that the specific measurements on the WoW wiki page have
to do with the implementation of Lua in World of Warcraft which is not
precisely stock Lua 5.1. The relative measures should still be valid,
however.
>> 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.
I just wanted to throw that out there, hopefully someone else is able
to come along and help answer the request of your questions =).
- Jim