Subject: Re: CVS commit: syssrc/sys/kern
To: Jaromir Dolecek <jdolecek@netbsd.org>
From: enami tsugutomo <enami@sm.sony.co.jp>
List: source-changes
Date: 11/30/2001 09:53:02
enami tsugutomo <enami@sm.sony.co.jp> writes:

> > Log Message:
> > crfree(): add DIAGNOSTIC sanity check of cr_ref; unfortunately, if the memory
> > is freed prematurely the check won't be triggered immediatelly, probably
> > since the memory is likely to be reused fast; but it _would_ be triggered
> > eventually
> 
> This check doesn't make sense also when crhold() is called
> sequencially (i.e., twice without crfree()), does it?

Ah, if you're expecting cr_ref is 0 after it is free(9)'ed, you can't.
You'll see 0xdeadbeef there (even if !DIAGNOSTIC, the first word is
used to hold a pointer in freelist).

enami.