lua-users home
lua-l archive

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


> I see instances of the aux library and standard libraries using
> lua_pushliteral to push strings onto a LUA stack, but cannot find any
> mention of the function in the manual.

Indeed, it's not there. Sorry.

> When & why should this be used instead of the normal lua_pushstring?

Use lua_pushliteral when you have a literal string instead of a string pointer.
lua_pushliteral is slightly faster than lua_pushstring because it avoids
a call to strlen; it also allows strings with embedded zeros.
--lhf