[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: tolua, c++, garbagecollection and memory management
- From: "Sebby " <beast@...>
- Date: Fri, 12 Jan 2001 03:27:56 -0000
This could easily be done with a C++ functor template to define the
stub functions. Here is a link to an example of functors
http://www.bestweb.net/~rhickey/
Sebastien St-Laurent
sebby@velocityhsi.com
--- In lua-l@egroups.com, James Hearn <james.hearn@b...> wrote:
> 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