From owner-cvs-all Fri Dec 8 17:24:15 2000 From owner-cvs-all@FreeBSD.ORG Fri Dec 8 17:24:11 2000 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id 8189637B400; Fri, 8 Dec 2000 17:24:11 -0800 (PST) Received: (from bright@localhost) by fw.wintelcom.net (8.10.0/8.10.0) id eB91OBw03133; Fri, 8 Dec 2000 17:24:11 -0800 (PST) Date: Fri, 8 Dec 2000 17:24:11 -0800 From: Alfred Perlstein To: John Baldwin Cc: cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org Subject: Re: cvs commit: src/sys/sys mutex.h Message-ID: <20001208172411.W16205@fw.wintelcom.net> References: <20001208164153.V16205@fw.wintelcom.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from jhb@FreeBSD.org on Fri, Dec 08, 2000 at 04:48:11PM -0800 Sender: bright@fw.wintelcom.net Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG * John Baldwin [001208 16:48] wrote: > > On 09-Dec-00 Alfred Perlstein wrote: > > * John Baldwin [001208 16:14] wrote: > >> jhb 2000/12/08 16:14:44 PST > >> > >> Modified files: > >> sys/sys mutex.h > >> Log: > >> Remove a comment that referrred to the obsolete mtxf struct. > > > > So with or without debug we waste space? or don't use any extra space? > > We don't use space. With debug, we (ab)use the description pointer to point to > a debug structure, and store the description pointer in that struct, with a > suitable #define of mtx_description. :) Due to this, you have to use a special > MUTEX_DECLARE() macro to declare mutexes initialized before malloc() is working > that statically allocates the appropriate mtx_debug and makes the mtx point to. > (Along with a special MTX_COLD flag for mtx_init() on these mutexes so that > mtx_init knows not to malloc() a debug struct but to use the one already > pointed to.) It's not the prettiest solution, but mtxf was uglier. :) I like this a lot better than mtxf. -- -Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org] "I have the heart of a child; I keep it in a jar on my desk." To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message