lua-users home
lua-l archive

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


On 15/02/14 22:54, Josh Haberman wrote:
> 
> I asked a question a while back about Lua strings and whether the API
> guarantees that their address will remain fixed.
> 
> http://lua-users.org/lists/lua-l/2011-06/msg00383.html
> 
> The consensus was that the API only guarantees that strings stay put
> while they're on the stack; at any other time a moving GC is allowed
> to relocate them (even though no implementation does this currently).
> 
> Now I'm wondering the same thing about full userdata. Unlike
> lua_tolstring(), lua_touserdata() contains no warning about pointers
> becoming invalid when the userdata is removed from the stack.
> 
> Does this mean that userdata are not allowed to be moved, even by a
> theoretical future moving GC?
> 
> Thanks,
> Josh
> 

http://article.gmane.org/gmane.comp.lang.lua.general/36034

-- 
Liam