lua-users home
lua-l archive

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


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Adrian Sietsma wrote:
[...]
> consider - if a userdata can move due to garbage collection, it would
> have _major_ implications for c routines. There would need to be clear
> rules on the lifetime of pointers returned from lua_newuserdata() and
> lua_touserdata(), and which operations may invalidate them. Or, some
> contract with the gc to say "leave this block alone".

I'd just assumed that the same rules as for strings applied --- i.e.,
that the pointer was valid only while it was on the Lua stack. As soon
as you remove it from the stack, the pointer becomes invalid.

- --
+- David Given --McQ-+
|  dg@cowlark.com    | "Those that repeat truisms, are also forced to
| (dg@tao-group.com) | repeat them." --- Anonymous from Slashdot
+- www.cowlark.com --+
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFERgPqf9E0noFvlzgRAtFvAKCnqkNO0XeQDbtRGgugMUcY3WgizACgmcyc
+kZkGIhAdsILpOzwe19JkBQ=
=d0d+
-----END PGP SIGNATURE-----