[cl-irc-devel] Circular references, garbage collection & library implementation

Erik Huelsmann e.huelsmann at gmx.net
Tue Mar 22 12:58:44 UTC 2005


Hi,


Although I really want to work on stuff like DCC and writing CTCP helper
functions for coloring etc., I think I need to address technical problems
first.

AFAICT, the current implementation will leak memory (ie won't be garbage
collected correctly) if users and channels are not removed (using
remove-user and remove-channel) before all references to a connection object
are lost/broken. In such cases, although nothing refers to the connection
object anymore, the channel may still contain user objects and the users
will still hold channel objects in their channel lists. In other words: they
won't be gc-able.

I'd like to change the library implementation to resolve this issue. It will
have some API consequences.

The idea is that even though there may be a very large number of users, the
number of channels will probably remain limited (several 10.000s max) and
that several thousands of hash lookups are fast. [I never run the library
with more than 20 channels...]

So, I'd like to bring back the one-way hierarchy in the library by
eliminating the channels list on the user object, replacing it by a channels
method which serves the same purpose, but dynamically collects the result.

Most user and channel operations will need a connection object to be passed
in to function correcly though.


bye,


Erik.

-- 
DSL Komplett von GMX +++ Supergünstig und stressfrei einsteigen!
AKTION "Kein Einrichtungspreis" nutzen: http://www.gmx.net/de/go/dsl



More information about the cl-irc-devel mailing list