Better lists? (Was: glib dependency for the X Server)
Ray Strode
halfline at gmail.com
Mon Apr 3 18:07:39 PDT 2006
Hi,
> > What's disappointing here is that having the do NULL pointer checks on
> > list element pointers was solved 20 years ago on the Amiga.
>
> I was almost going to say the same... Are we the only ones who
> find the glib list API so clumsy and error prone? The only time
> I used them I've spent quite some time debugging memory corruption
> bugs caused by subtle mistakes like forgetting to re-assign the
> list head in glib.
Note glib provides a wrapper around GList called GQueue that you might
like better. It manages the head pointer for you, keeps track of the
list length, and keeps a tail pointer for O(1) appends.
(getting pretty far offtopic though)
--Ray
More information about the xorg
mailing list