Subject: Re: PROPOSAL: removal of brk()/sbrk().
To: None <tech-kern@netbsd.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-kern
Date: 02/28/2002 19:18:33
>>> I don't actually see why there is a gain from using mmap() directly
>>> for malloc()?
>> Well, there isn't any, per se.  The gain actually comes from
>> eliminating sbrk (and brk) entirely; [...]
> I don't think that's at all correct.  If you ever use sbrk(), [...]

Right.  That's why some people are pushing to make it possible to build
a system that doesn't support sbrk at all.  But to make this feasible,
all modern users of sbrk have to be eliminated, and malloc is the most
predominant of those.

I'd still prefer to see the VM space rearranged, for the sake of
systems that _are_ built to support sbrk, but that's a different issue.

> So what do we really gain by changing malloc() to use mmap() instead
> of sbrk()?  Nothing.

Not quite.  The gain really comes from eliminating sbrk (and brk)
entirely; moving malloc over to mmap is just a necessary step on that
road.

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse@rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B