On Mon, 2003-01-20 at 11:57, Einar Karttunen wrote:
> Are you aware of the problems associated with reference counting?
> - usually slower than proper garbage collector
> - cyclic references cause memory leaks

If I knew GC would work well, I'd use it. With plain C code the Boehm GC
seems to work fine enough, but I have doubts how well it would work with
Perl or other scripting languages. Last I tried it kept leaking memory
all the time, but maybe it would be possible to fix it. 

That could be tested with current irssi code actually. What would have
to be done is erase perl objects' _irssi variable after Perl is
destroying the object.

I'm planning on keeping the number of refcounted objects rather low
though, so I'd think a GC scanning through the heap (especially the
memory allocated by perl, which would be refcounted in any case) would
be a lot slower than keeping track of around 100-1000 objects,
especially if the refcounter wouldn't be updated very often (mostly just
Perl I think).

> An another important point would be to make the scripting features
> language independent i.e. not tie irssi with perl in any special way.
> Just define a clean interface to which languages can easily attach
> themselves. Maybe using SWIG (http://www.swig.org) is an option for
> this...

I'll have to look at that. But Irssi isn't tied into Perl in any way
even now, and will not in future versions.


Reply via email to