On Fri, Jan 25, 2002 at 09:14:48AM -0500, Chris Mason wrote:
> 
> 
> On Friday, January 25, 2002 10:23:28 PM +1100 Andrew Clausen
> <[EMAIL PROTECTED]> wrote:
> 
> >> ----- quote from Andi from a different thread --
> >> > 
> >> > mmap(NULL, ...) will be slow because it uses a linear search over all
> >> > mappings of the current process. If you manage the address space
> >> > yourself and specify an address to map to mmap it'll be fast because
> >> > it uses an scalable data structure (AVL or RBtree) in this case. I
> >> > would suggest doing that if you rely a lot on mmap with many mappings. 
> > 
> > So, isn't the way to do that malloc(3) and mmap(2)?

The way to "manage the address space" is to malloc(3) buffers, and then
mmap(2) them.  malloc(3) (i.e. brk(2)) doesn't allocate buffers.

Is this right?

> > Or even read(2)/write(2) should achieve the same effect.  (Why didn't I
> > think of this before!)

As you pointed out in private, this is incorrect.  Thanks :)

Andrew

Reply via email to