lua-users home
lua-l archive

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


2010/4/12 Andreas Falkenhahn <andreas@airsoftsoftwair.de>:
>
> Hi,
>
> when I use luaL_ref() on a string that is on top of the stack, and then obtain a pointer
> to this string. Is this pointer guaranteed to be valid until I call luaL_unref() or could
> the string be moved to an other memory location across function calls?
>
> Tks,
>
> Andreas
> --
> "Remember: It's nice to be important but it's more important to be nice!"
>
>
>

I believe that standard Lua does not move things like strings around
in memory, but it may not be safe to rely on that in any other
implementation (e.g. LuaJIT).

-Duncan