Re: [tabled patch] abstract out TCP-write code

Jeff Garzik <[email protected]> Thu, 23 Sep 2010 19:51:18 -0400
Newsgroups org.kernel.vger.hail-devel
Message-ID <[email protected]>
On 09/22/2010 10:37 PM, Pete Zaitcev wrote:
> On Wed, 22 Sep 2010 21:26:13 -0400
> Jeff Garzik<[email protected]>  wrote:
>> It is a common idiom even in GLib that callbacks receive two anonymous
>> pointers; witness the data type GFunc's 'data' and 'user_data'
>> arguments:
>> http://library.gnome.org/devel/glib/stable/glib-Doubly-Linked-Lists.html#GFunc
>
> There's a lot of retarged garbage in Glib, just look at their lists.
> If someone smarter wrote Glib, we would not need struct list_head.

I use both list types, because there's a use case for both.  You don't 
always have the luxury of having a struct in which to embed data+next 
pointers.  Allocated strings are an excellent example.

GFunc has two parameters for a reason :)  See for example 
http://library.gnome.org/devel/glib/stable/glib-Doubly-Linked-Lists.html#g-list-foreach

It really is a common idiom, based on a common need, not just my style 
preference.  :)

	Jeff