lua-users home
lua-l archive

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


> How are the various limits in Lua below related to the size of the
> operands in Lua bytecode instruction? I assume that if the operand A
> is 7-bits then MAXREGS must be set to <= 127?
> 
> MAXVARS (in lparser.c)
> MAXREGS (in lcode.c)
> LUAI_MAXCCALLS in (llimits.h)
> MAXUPVAL (in llimits.h)

MAXVARS, MAXREGS, and MAXUPVAL are limited by the size of operand A (and
the other operands, too); they must fit in any operand. (In particular,
MAXUPVAL has an awkward definition, that is legacy from older times :-)

LUAI_MAXCCALLS has nothing to do with that.

-- Roberto