lua-users home
lua-l archive

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

It was thus said that the Great Juris Kalnins once stated:
> On Wed, 07 Oct 2009 09:14:45 +0300, Sean Conner <> 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.