From owner-freebsd-arch Thu Jan 4 0:20: 0 2001 From owner-freebsd-arch@FreeBSD.ORG Thu Jan 4 00:19:58 2001 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id 0C33137B402; Thu, 4 Jan 2001 00:19:58 -0800 (PST) Received: (from bright@localhost) by fw.wintelcom.net (8.10.0/8.10.0) id f048Jhf19608; Thu, 4 Jan 2001 00:19:43 -0800 (PST) Date: Thu, 4 Jan 2001 00:19:43 -0800 From: Alfred Perlstein To: Kirk McKusick Cc: Will Andrews , Peter Wemm , Stephen McKay , phk@FreeBSD.ORG, arch@FreeBSD.ORG Subject: Re: Reinstatement of CIRCLEQ Message-ID: <20010104001943.T292@fw.wintelcom.net> References: <20010103124110.L86630@argon.firepipe.net> <200101040719.XAA04872@beastie.mckusick.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200101040719.XAA04872@beastie.mckusick.com>; from mckusick@mckusick.com on Wed, Jan 03, 2001 at 11:19:02PM -0800 Sender: bright@fw.wintelcom.net Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG * Kirk McKusick [010103 23:19] wrote: > > As the original author of I would like to speak up > in support of the removal of CIRCLEQ. They were originally added > because I had not thought up a portable way to traverse TAILQ's > in reverse and certain applications need that functionality. A > few years ago, when reviewing the TAILQ functions, I realized that > it is in fact possible to traverse TAILQ's in reverse in a portable > way and added the TAILQ_PREV function. With this addition, there > were no capabilities left in CIRCLEQ that could not be done with > TAILQ in a more efficient manner (TAILQ's generate fewer tests > when doing their operations than CIRCLEQ's). Further, the termination > conditions for TAILQ's (testing against NULL) are much simpler and > more easily coded than the termination condition for CIRCLEQ's > (saving the queue head and checking to see if it has been reached). > CIRCLEQ's have been very lightly used, and few users will be > inconvenienced by their removal. The resulting code base will be > simpler, faster, and cleaner. There are times when one should > break with the past, and I believe that this is just such a time. *blush* You're right, I'm wondering though, would it be possible to change TAILQ_PREV(elm, headname, field) to TAILQ_PREV(elm, field) by using the offset of 'field' into the struct? You could subtract the offset of 'field' from the tqe_prev of the next struct right? This would also reduce it by one memory access. Or is this the unportability/headache you were trying to avoid? -Alfred To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message