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

Carsten Haitzler (The Rasterman) raster at rasterman.com
Wed Apr 5 16:53:28 PDT 2006


On Wed, 05 Apr 2006 20:10:35 +0200 Bernardo Innocenti <bernie at develer.com>
babbled:

> 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.

sure - many ways to skin a cat. we can argue for a while about list
implementations i'm sure and never come to a unanimous agreement. :) also
performance may vary considerably from platform to platform depending on cycles
vs memory latency etc. etc.

> 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.

hmm - i actually find g_list quite nice and usable - but again - i think we are
really discussing personal preference more than anything else :)

> -- 
>   // Bernardo Innocenti - Develer S.r.l., R&D dept.
> \X/  http://www.develer.com/
> 


-- 
------------- Codito, ergo sum - "I code, therefore I am" --------------
The Rasterman (Carsten Haitzler)    raster at rasterman.com
裸好多
Tokyo, Japan (東京 日本)



More information about the xorg mailing list