[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: tolua, c++, garbagecollection and memory management
- From: James Hearn <james.hearn@...>
- Date: Thu, 11 Jan 2001 16:19:28 -0600
Christian Vogler wrote:
>
> On Thu, Jan 11, 2001 at 02:50:14PM -0200, Waldemar Celes wrote:
> > no, it won't be collected. objects created with "new" should be
> > explicitly deleted with "delete". or you may call the function
> > "takeownership" to tell tolua to collect it when it leaves the
> > scope.
>
> I wrote some meta-code that makes this somewhat easier. Basically, if
> you define a class A, it lets you do the following:
>
> uncollected_instance = A:new(blah ...)
> collected_instance = A(blah ...)
>
> The first syntax does not take ownership, while the second one
> does. Siome and I find this pretty convenient in our project. If
> anyone is interested, e-mail me, and I will make it available.
>
> I also have a whole bunch of tips and tricks for generating good C++
> bindings with tolua. Trouble is only, they all pertain to tolua 3.2,
> and I'm not sure how many of them are still valid for tolua 4.0. But
> again, if anyone is interested, I will be happy to share them.
>
> - Christian
I would be very interested in hearing your tips. I'm about to bind a c++
game-windowing toolkit to lua, and any info would be helpful.
--James Hearn