Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Jun 2005 12:43:56 +0100
From:      Peter Edwards <peadar.edwards@gmail.com>
To:        Jon Dama <jd@ugcs.caltech.edu>
Cc:        Peter Edwards <peadar@freebsd.org>, Maxim.Sobolev@portaone.com, current@freebsd.org
Subject:   Re: Towards a working "wine". [long]
Message-ID:  <34cb7c840506180443586ac065@mail.gmail.com>
In-Reply-To: <Pine.LNX.4.53.0506171757250.13669@regurgitate.ugcs.caltech.edu>
References:  <20050617180232.GA25818@freefall.freebsd.org> <42B31247.9010603@portaone.com> <34cb7c840506171121cd0437f@mail.gmail.com> <42B3189E.6030408@portaone.com> <34cb7c8405061716327ca4c6d7@mail.gmail.com> <Pine.LNX.4.53.0506171757250.13669@regurgitate.ugcs.caltech.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On 6/18/05, Jon Dama <jd@ugcs.caltech.edu> wrote:
> My intuition says that mmap should ignore requests to map into the
> existing brk region but not reject requests that are merely between the
> existing brk region and the DS limit.
>=20
> Is this what happens now?
>=20

For the non-MAP_FIXED case, if the hint is in the data segment (ie, in
the range [daddr, daddr + RLIMIT_DATA), _not_  [daddr, break)), or is
NULL, it's adjusted to be just beyond the data segment. So, by
default, mmap() starts looking for space after the data segment.

So a low "hint", ie., one before the start of the data segment _wont_
be adjusted.

The hint itself is used as the starting address for the search for
enough address space to use: this search will return as soon as its
found enough room in the processes memory map.

Actually, there's a bit of a problem here: if you specify a low
address before the data segment, you can actually get mmap to deliver
memory inside the possible limits of the data segment, but after the
current position of the "break". It's certainly confusing behaviour,
but it might have some historical significance: Comments, anyone?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?34cb7c840506180443586ac065>