Date: Mon, 29 Jan 2001 14:37:46 -0500 From: "Bosko Milekic" <bmilekic@technokratis.com> To: "Boris Popov" <bp@FreeBSD.org>, <cvs-committers@FreeBSD.org>, <cvs-all@FreeBSD.org> Subject: Re: cvs commit: src/sys/kern kern_malloc.c src/sys/sys malloc.h Message-ID: <00ff01c08a2a$f4d98710$1f90c918@jehovah> References: <200101291248.f0TCmg157616@freefall.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?00ff01c08a2a$f4d98710$1f90c918>