[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Uncommon OOP in Lua: right or wrong?
- From: Roberto Ierusalimschy <roberto@...>
- Date: Mon, 27 Sep 2010 18:50:22 -0300
> I was worried about duplicated bytecode myself, but it looks like Lua
> doesn't copy the bytecode when creating a new closure, it just links to
> the upvalues and has a pointer to a single "function prototype"
> containing the bytecode and the constants.
>
> Source (Lua 5.1.4):
> lvm.c, Lines 719 - 738
> lobject.h, Lines 228 - 312
> lfunc.c, Lines 33 - 41
>
> ...assuming I understood the code correctly.
You did.
-- Roberto