lua-users home
lua-l archive

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


2007/1/7, howard chen <howachen@gmail.com>:
Are there similar to C/C++ inline function systax in Lua?

I have a small function but will be called quite frequent, if
inline-ed, it might give some performance gain as there will be no
function call

There is no such thing as inlining in Lua, since the closure mechanism
used by Lua impose to resolve most things at runtime. The only
optimization in stock Lua specific to functions calls is the tail
call, that let you optimize a bit your stack usage.