Subject: Re: fdexpand() memory shortage check (Re: kern/14721)
To: None <tech-kern@netbsd.org>
From: David Laight <David.Laight@btinternet.com>
List: tech-kern
Date: 12/15/2001 17:06:38
Subject: Re: fdexpand() memory shortage check (Re: kern/14721)


> On Fri, Dec 14, 2001 at 11:32:38PM -0800, Chuck Silvers wrote:
> > to make this even neater, we could still do all of this with the malloc()
> > interface, with a different new flag, M_NOINTR or something like that.
> 
> on second thought, I'm confusing my kernel memory allocators.
> BSD's free() takes a type rather than a size, so it would have
> have a hard time determining how to free M_NOINTR allocations
> even once it knew they were M_NOINTR.  it would probably be best
> to make separate interfaces for non-interrupt-safe memory allocation.

It is probably safer to have only one free() routine - then you can't
call the wrong one!  It ought to be easy (and relatively cheap) to
use the virtual address to determine the size and type of allocation.

    David