Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Dec 2000 17:24:11 -0800
From:      Alfred Perlstein <bright@wintelcom.net>
To:        John Baldwin <jhb@FreeBSD.org>
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>
In-Reply-To: <XFMail.001208164811.jhb@FreeBSD.org>; from jhb@FreeBSD.org on Fri, Dec 08, 2000 at 04:48:11PM -0800
References:  <20001208164153.V16205@fw.wintelcom.net> <XFMail.001208164811.jhb@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
* John Baldwin <jhb@FreeBSD.org> [001208 16:48] wrote:
> 
> 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. :)

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001208172411.W16205>