From owner-freebsd-current Wed Mar 10 11:35:32 1999 Delivered-To: freebsd-current@freebsd.org Received: from phk.freebsd.dk (phk.freebsd.dk [212.242.40.153]) by hub.freebsd.org (Postfix) with ESMTP id 8CCB3153F0 for ; Wed, 10 Mar 1999 11:35:22 -0800 (PST) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.40.131]) by phk.freebsd.dk (8.9.1/8.8.8) with ESMTP id UAA21323; Wed, 10 Mar 1999 20:35:03 +0100 (CET) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.9.2/8.9.2) with ESMTP id UAA32859; Wed, 10 Mar 1999 20:34:52 +0100 (CET) (envelope-from phk@critter.freebsd.dk) To: Matthew Dillon Cc: Dag-Erling Smorgrav , sthaug@nethelp.no, dcs@newsguy.com, Jos.Backus@nl.origin-it.com, dima@tejblum.dnttm.rssi.ru, perhaps@yes.no, freebsd-current@FreeBSD.org Subject: Re: panic: zone: entry not free In-reply-to: Your message of "Wed, 10 Mar 1999 11:05:11 PST." <199903101905.LAA57081@apollo.backplane.com> Date: Wed, 10 Mar 1999 20:34:52 +0100 Message-ID: <32857.921094492@critter.freebsd.dk> From: Poul-Henning Kamp Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG You two are basically discussing "overspecifying source code" vs "normal source code". It doesn't really matter much if the overspecifying consists of merging the TeX sources for a book or by adding invariants as part of design verification. The discussion itself has about as much merit as our recent style(9) discussions, split infinitives included or not: It is pointless. We already have one option in the kernel for "increased sanity checks", it's called "DIAGNOSTIC" and it is legal to add (even substantial) amounts of extra code under that option, as long as there is a sensible reason. Several of my kernels run with DIAGNOSTIC defined, and debug symbols and basic-block profiling to boot. And yes, I do find bugs that way. And no, I would hate to spend 50% of my performance on those options in production. Considering that I think a sensible approach here would be to define a global macro called "INVARIANT(condition, text)" as follows: #ifdef DIAGNOSTIC #define INVARIANT(condition, text) if (condition) ; else panic(text) #else #define INVARIANT(condition, text) do ; while (0) #endif In a suitably global kernel include file. Can everybody live with that as a compromise ? -- Poul-Henning Kamp FreeBSD coreteam member phk@FreeBSD.ORG "Real hackers run -current on their laptop." FreeBSD -- It will take a long time before progress goes too far! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message