David Balmain scribbled on 10/13/06 1:21 AM:

I don't know how much of Ferret's binding code you've looked at but
you may have noticed a lot of my structs have a ref_cnt variable. That
way, every time a struct gets wrapped in a ruby object, it's ref_cnt
is incremented. When the object goes out of scope and is garbage
collected the ref_cnt is decremented (and the object deleted if
ref_cnt = 0). I think as far as supporting multiple languages like we
are attempting to do with Lucy, this is the easiest way to go, since
it should work for all languages.


Hi folks,

Interesting thread.

fwiw, I have used the above approach in Perl myself. I just increm/decrem the refcnt in XS (Perl) space, in the DESTROY method.
--
Peter Karman  .  http://peknet.com/  .  [EMAIL PROTECTED]

Reply via email to