[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: LUA missing lua_pushuserdata()?
- From: Sean Conner <sean@...>
- Date: Wed, 7 Oct 2009 02:37:18 -0400
It was thus said that the Great Juris Kalnins once stated:
> On Wed, 07 Oct 2009 09:14:45 +0300, Sean Conner <email@example.com> wrote:
> > I can easily add the lua_pushuserdata() function myself
> I'd like to see that, honestly.
> How will you check that your userdata has not been garbage collected yet?
I didn't think of that (which may explain why lua_pushuserdata() doesn't
exist). But in the usage pattern I have going, the userdata is created,
passed to the coroutine for processing, and once the coroutine is done, I'm
done with the userdata.
The reason I'm using the userdata and not a lightuserdata is the former I
can attach a metatable to, which would simplify the Lua code a bit.