Date: Fri, 08 Dec 2000 16:48:11 -0800 (PST) From: John Baldwin <jhb@FreeBSD.org> To: Alfred Perlstein <bright@wintelcom.net> Cc: cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org Subject: Re: cvs commit: src/sys/sys mutex.h Message-ID: <XFMail.001208164811.jhb@FreeBSD.org> In-Reply-To: <20001208164153.V16205@fw.wintelcom.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On 09-Dec-00 Alfred Perlstein wrote: > * John Baldwin <jhb@FreeBSD.org> [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 <jhb@FreeBSD.org> -- 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.001208164811.jhb>