Re: upcoming changes in Lua 5.2 [was Re: Location of a package]
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: upcoming changes in Lua 5.2 [was Re: Location of a package]
- From: Daan Nusman <d.nusman@...>
- Date: 2008年2月22日 13:31:24 +0100
Ignacio Burgueño wrote:
David Burgess wrote:
Can you add
lua_State* mL= luaL_getmainthread(L); // returns the main lua state
to the list?
I second that. Also, at the moment, checking if a thread is the main
one is a little cumbersome (i.e. pushthread, checking the return value
and then poping the thread). luaL_getmainthread would allow for an
easy equality test.
Thirdsies! It's the only thing we add to ourselves, even though we're
using Lua for large projects. With "lua_" instead of "luaL" though.
Wouldn't it be more something of a core function?
To elaborate: we're using it to make sure a wrapper class for Lua refs
works correctly. A reference wrapper class stores a pointer to the Lua
*main* state (using the custom lua_getmainthread call) so it can free
the reference on demand when the class destructor is called. If you
store any Lua state, you might store a pointer to a thread that could
already deleted when the destructor of the reference wrapper class is
called, causing a crash. lua_pushthread doesn't help us in this case.
--
Kind regards,
Daan Nusman, M.Sc.
re-lion
+31 53 4356687
- References:
- Location of a package, Ignacio Burgueño
- Re: Location of a package, Ignacio Burgueño
- Re: Location of a package, Fabien
- Re: Location of a package, Roberto Ierusalimschy
- Re: Location of a package, eugeny gladkih
- upcoming changes in Lua 5.2 [was Re: Location of a package], Roberto Ierusalimschy
- Re: upcoming changes in Lua 5.2 [was Re: Location of a package], Mike Pall
- Re: upcoming changes in Lua 5.2 [was Re: Location of a package], Patrick Donnelly
- Re: upcoming changes in Lua 5.2 [was Re: Location of a package], Roberto Ierusalimschy
- Re: upcoming changes in Lua 5.2 [was Re: Location of a package], David Burgess
- Re: upcoming changes in Lua 5.2 [was Re: Location of a package], Ignacio Burgueño