lua-users home
lua-l archive

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


On 7 December 2011 13:43, Luiz Henrique de Figueiredo
<lhf@tecgraf.puc-rio.br> wrote:
>> So in case of string, is the C stack able to access the Lua address
>> space where I have stored the string?
>
> Yes. lua_tostring gives you that address. Use it freely while the string
> is in the Lua/C stack. Just don't save that address for later unless
> you're positive that the string won't be collected.

Just a reminder - do not attempt to modify the string you get from
Lua. If you need to change it, you should copy it into your own
buffer.