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


_______________________________________________
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to