From owner-cvs-all Mon Jan 29 11:37:11 2001 Delivered-To: cvs-all@freebsd.org Received: from VL-MS-MR002.sc1.videotron.ca (relais.videotron.ca [24.201.245.36]) by hub.freebsd.org (Postfix) with ESMTP id 7D1F437B698; Mon, 29 Jan 2001 11:36:38 -0800 (PST) Received: from jehovah ([24.201.144.31]) by VL-MS-MR002.sc1.videotron.ca (Netscape Messaging Server 4.15) with SMTP id G7XVS001.H6F; Mon, 29 Jan 2001 14:36:01 -0500 Message-ID: <00ff01c08a2a$f4d98710$1f90c918@jehovah> From: "Bosko Milekic" To: "Boris Popov" , , References: <200101291248.f0TCmg157616@freefall.freebsd.org> Subject: Re: cvs commit: src/sys/kern kern_malloc.c src/sys/sys malloc.h Date: Mon, 29 Jan 2001 14:37:46 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2919.6700 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Boris Popov wrote: > bp 2001/01/29 04:48:41 PST > > Modified files: > sys/kern kern_malloc.c > sys/sys malloc.h > Log: > Add M_PANIC flag to the list of available flags passed to malloc(). > With this flag set malloc() will panic if memory allocation failed. > This usable only in critical places where failed allocation is fatal. > > Reviewed by: peter > > Revision Changes Path > 1.81 +7 -3 src/sys/kern/kern_malloc.c > 1.52 +2 -1 src/sys/sys/malloc.h Why is this change necessary? Rather, how is this change correct? I'd rather not introduce this sort of thing into the actual interface, unless it's realistically necessary, as I can see how this may encourage some people writing drivers (or an equivalent) to decide that they ought to panic the machine if they can't allocate. I'd rather see this dealt with, where absolutely necessary, by calling malloc() with M_NOWAIT and checking the return value and then calling panic explicitly if it is NULL. Please note in advance that I am not objecting, right off the bat, to the commit. I'd simply like to understand some of the reasoning behind it. :-) Regards, Bosko. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message