[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-hackers
Subject:    Re: kernel assertions (Rev. 1)
From:       Michael Hancock <michaelh () cet ! co ! jp>
Date:       1996-07-31 14:50:38
[Download RAW message or body]

On Tue, 30 Jul 1996, Michael L. VanLoon -- HeadCandy.com wrote:

> >The REQUIRE2 stuff can replace the 
> >
> >#ifdef DIAGNOSTICS
> >	if (expr)
> >		panic(expl);
> >#endif
> 
> I prefer asserts to call "Debugger()", rather than "panic()", and
> that's how I write my assertion macros.  How are you supposed to debug
> something if it panics?

I'd be happy either way.  The point I was trying to make was that REQUIRE2
could replace the "tentative looking" argument checking in the code that
often manifests itself in the form above.

REQUIRE2 would also hopefully induce people to consistently do simple
argument checking, because there is no overhead in the production code.

The REQUIRE1 assertions would remove the argument checking that's
integrated with the real code, just leaving REAL code.  They would then
be reinstated at the top where they belong.

These are level I checks because obviously the author thought they were
important enough to integrate the argument checking logic with the code
doing the real work.

Let's go for HIGHER QUALITY!!!

nuff, said.

Regards,


Mike Hancock

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic