[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Boxed userdata and garbage collector
- From: Florian Weimer <fw@...>
- Date: Sat, 04 Sep 2010 11:48:59 +0200
* Michal Kottman:
> I have a similar problem - I am currently creating a binding for the
> OpenCV library. This solution cannot be applied in my case, because I
> cannot (and do not want to) modify the library. A common pattern in
> OpenCV is this (this is how I imagine the binding):
>
> while not finished do
> local img = cv.RetrieveFrame(cam) -- retrieves image from cam
> -- do some processing
> end
Would it be possible to write this instead?
while not finished do
local img = cv.RetrieveFrame(cam) -- retrieves image from cam
-- do some processing
img:release()
end
This doesn't seem to be too onerous to me.
(In exception handlers, you should perform full collections if you
follow this style, but that shouldn't result in performance problems
as long as exceptions are rare.)
- References:
- Boxed userdata and garbage collector, Sylvain Fabre
- Re: Boxed userdata and garbage collector, Florian Weimer
- Re: Boxed userdata and garbage collector, Sylvain Fabre
- Re: Boxed userdata and garbage collector, Jonathan Castello
- Re: Boxed userdata and garbage collector, Sylvain Fabre
- Re: Boxed userdata and garbage collector, Jonathan Castello
- Re: Boxed userdata and garbage collector, Ted Unangst
- Re: Boxed userdata and garbage collector, Peter Cawley
- Re: Boxed userdata and garbage collector, Ted Unangst
- Re: Boxed userdata and garbage collector, Peter Cawley
- Re: Boxed userdata and garbage collector, Ted Unangst
- Re: Boxed userdata and garbage collector, Michal Kottman