[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Do strings move around?
- From: v <v19930312@...>
- Date: Tue, 25 Aug 2020 17:30:09 +0300
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>