Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Dec 2003 23:59:25 -0500
From:      Stephan Uphoff <ups@stups.com>
To:        freebsd-hackers@FreeBSD.ORG
Subject:   (mtx|sx)_init zeroed memory requirement plans?
Message-ID:  <200312260459.XAA17441@stups.com>

next in thread | raw e-mail | index | archive | help

Currently both mtx_init() and sx_init() make assumptions about the
lock memory passed in.	( KASSERT((lock->lo_flags & LO_INITIALIZED) == 0))

To fulfill this requirement current code that works with dynamically 
allocated memory routinely zeroes the lock memory space before
calling the lock initialization function.
( Or allocates zeroed memory)

Is this (undocumented?) behavior just a temporary debugging aid - or
will it stay around ?

If it is not going away anytime soon I would suggest adding 
MTX_PREPARE and SX_PREPARE macros instead of zeroing the lock memory.

This would make it easier to remove or optimize lock memory preparation
later on.


	Stephan




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