> Is N very high? If not, why not just allocate N - 1 bytes
> too much and then advance the pointer to the memory block to
> the next N-byte boundary?
N is a megabyte by default. I don't like doing too many mmaps, especially
mmaping more memory than we need, because some operating systems tend to
take it too seriously and allocate swap etc. making it fairly expensive. I
don't think Linux is in this category - it just allocates entries in page
tables and zero-faults the pages as necessary.
Anyway, your scheme would make a good fallback mechanism. Incedentally,
this is the first time I've heard of it failing, which is why I haven't been
too bothered about fixing it!
Cheers,
Simon
--
Simon Marlow
Microsoft Research Ltd., Cambridge, U.K.