Better lists? (Was: glib dependency for the X Server)

Bernardo Innocenti bernie at
Wed Apr 5 11:10:35 PDT 2006

Carsten Haitzler (The Rasterman) wrote:

>> The downside is that you need to add nodes inside your data
>> structures.  If you need to link a structure into several
>> lists at the same time, you'll have to use tricks such as
>> container_of() to recover the pointer to the original
>> structure (no big deal, really).
> sure - i do that. i simply provided a generic list impl that looks & feels very
> much like g_lists for the purpose of providing an existing debugged
> implementation of a data struct that was needed. :)

Yeah, I didn't mean to say anything against the quality of
tour GList reimplementation (which looks fine) and its
usefulness to avoid a dependency on glib (which is probably
worthwile in Xorg code).

If Eric Anholt already wrote and debugged that code, your
contribution would be very useful.  I was just arguing against
using the GLib list design for new code.

Almost any other linked list API I've seen is IMHO more usable,
robust, or efficient including std::list<T>, QList<T>, and those
Amiga-like lists we were talking about.

  // Bernardo Innocenti - Develer S.r.l., R&D dept.

More information about the xorg mailing list