[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: RE: Questions on userdata
- From: "Joshua Jensen" <jjensen@...>
- Date: Mon, 11 Feb 2002 09:17:21 -0700
> >1) malloc vs newuserdata
> I don't know for sure the answers to most of your questions,
> but one point is: If you're encapsulating a C++ object in a
> user data type, you need to use the "malloc" method (an
> operator new, in that case).
Doing a C++ non-placement new works fine. You just have to:
1) Use lua_newuserdatabox().
2) Possibly provide a gc tag, depending on how and when you want your
C++ object freed.