lua-users home
lua-l archive

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


> You can also ensure that it doesn't get garbage collected by getting a
> reference to the string, using lua_ref.

Even then, you should not keep the "char *" yourself. Although this
works now, it is not officially supported by Lua. If you use lua_ref,
you should use lua_getref to retrieve the string when you need.
(Eventually we may want the freedom to move the string when it is not
being used by C; that is, it is not in the stack of a C function.)

-- Roberto