lua-users home
lua-l archive

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


lua_pushliteral is a macro defined in the lua.h file. Use it when you want to push a string literal, that is, a string whose value is specified directly in the macro call. The advantage of lua_pushliteral is that it uses the sizeof operator to determine the length of the string literal; this computation can be performed at compile time, thus eliminating a call to strlen or equivalent. So lua_pushliteral is more efficient for pushing string literals than lua_pushstring.

Matt