From owner-cvs-all Fri Dec 8 16:48: 8 2000 From owner-cvs-all@FreeBSD.ORG Fri Dec 8 16:48:04 2000 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from pike.osd.bsdi.com (pike.osd.bsdi.com [204.216.28.222]) by hub.freebsd.org (Postfix) with ESMTP id AE46E37B400; Fri, 8 Dec 2000 16:48:04 -0800 (PST) Received: from laptop.baldwin.cx (john@jhb-laptop.osd.bsdi.com [204.216.28.241]) by pike.osd.bsdi.com (8.11.1/8.9.3) with ESMTP id eB90lM770924; Fri, 8 Dec 2000 16:47:22 -0800 (PST) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20001208164153.V16205@fw.wintelcom.net> Date: Fri, 08 Dec 2000 16:48:11 -0800 (PST) From: John Baldwin To: Alfred Perlstein Subject: Re: cvs commit: src/sys/sys mutex.h Cc: cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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. :) -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.baldwin.cx/~john/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message