full userdata guaranteed to not move?
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: full userdata guaranteed to not move?
- From: Josh Haberman <jhaberman@...>
- Date: 2014年2月15日 14:54:51 -0800
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