[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Replacement for unlocked refs?
- From: "J. Perkins" <jason@<a href="/cgi-bin/echo.cgi?379.com">...</a>>
- Date: Fri, 01 Feb 2002 16:55:21 -0500
Peter Loveday wrote:
How do you pass your userdata object into Lua calls? That is, say I
have C++ code that wants to call a function like:
int doSomething(MyObject* obj);
Yep, in my case the number of calls like this is relatively minimal. I
do indeed just push a newuserdatabox() every time.
I haven't found this to be a problem for what I'm doing, but I can see
that it could become prohibitive in other applications.
It turns out I only do this a few places in my code, but
it gets run every frame (it's a game project) which adds
up quickly. The number of such calls is likely to grow
significantly once it gets out to the endusers, so it looks
like I'll have to roll-my-own weak reference system.
It's not that it's all that hard to do, just that it
seems like something that should be built in.