lua-users home
lua-l archive

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


On Tue, 2020-08-25 at 15:41 +0200, Francisco Olarte wrote:
> It seems likely, and it is true on userdata, but the wording on
> lua_tostring make me fear the string can me moved around by the
> collector if it is not pinned especifically by a stack entry.

I'm pretty sure it is safe. AFAIK it does not matter where data is
stored when it comes to Lua managing it. And as such, storing anything
in stack should not differ from storing it anywhere else as strings are
allocated internally and every Lua "string", on stack or not, is just a
reference there.
-- 
v <v19930312@gmail.com>