From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Garzik Subject: Re: [tabled patch] abstract out TCP-write code Date: Thu, 23 Sep 2010 19:51:18 -0400 Message-ID: <4C9BE7F6.7010301@garzik.org> References: <20100923000908.GA15908@havoc.gtf.org> <20100922182836.566df309@lembas.zaitcev.lan> <4C9AACB5.40403@garzik.org> <20100922203741.48a2b8e6@lembas.zaitcev.lan> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=EluHJmb/qrQWE9hZkflMKF51iIiU6ir41hNgBdAHAKA=; b=VRtYKyj7Kok2Ntt+hGHmBqMgcBIFXg/NrmAIRK9Ovij0sFjIotZDxhZqakzCDzsGF7 vLTieqpx+4ztGbS0QxJKB6vybjgiq1w/k3I2DbWxEyUZXKR1V4xWQFhvbWUrfHr10ei+ LySkAazy+RzpkY6bjKu1T6VU6GbjNn7Y/XTyo= In-Reply-To: <20100922203741.48a2b8e6@lembas.zaitcev.lan> Sender: hail-devel-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: Pete Zaitcev Cc: hail-devel@vger.kernel.org On 09/22/2010 10:37 PM, Pete Zaitcev wrote: > On Wed, 22 Sep 2010 21:26:13 -0400 > Jeff Garzik 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