lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> 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