[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: detecting mmap?
From: |
Donn Terry |
Subject: |
RE: detecting mmap? |
Date: |
Fri, 19 Jul 2002 08:12:46 -0700 |
1) Please don't confused MAP_FIXED in the general case with MAP_FIXED
over the top
of (ordinary) heap, which is what is being tested. I guess there's a
way that that
could be useful, but I find it hard to conceive of a situation where
doing that offers
much over putting the same object elsewhere in the address space.
The test for MAP_FIXED
that currently exists tests for being able to map over heap.
2) MAP_FIXED when applied to addresses already returned by a prior call
to mmap can
be quite useful, and I was trying to make that specific distinction.
I haven't looked at gnu grep, but it's worth asking why the mmap()ed
region couldn't
be just as easily elsewhere.
I've run across at least a couple of real-world examples where mmap()
(either without
MAP_PRIVATE at all or limited to prior mmap()ed addresses) is still
quite useful. (In
fact, the applications run just fine.) I'll have to refresh myself on
which ones; that
was some time ago.
Donn
-----Original Message-----
From: Paul Eggert [mailto:address@hidden
Sent: Thursday, July 18, 2002 11:46 PM
To: Donn Terry
Cc: address@hidden
Subject: Re: detecting mmap?
> From: "Donn Terry" <address@hidden>
> Date: Wed, 17 Jul 2002 10:01:54 -0700
>
> It's perfectly reasonable for the implementation to consider an
> address in the (ordinary) heap as invalid (just as much as it might
> consider code or data invalid).
It may sound perfectly reasonable to _you_, but but it doesn't sound
reasonable to _me_. Such an implementation will break or will hurt the
performance of several applications (GNU grep being one example).
That being said, it wouldn't hurt to have a different flavor of
AC_FUNC_MMAP that has a weaker check for compatibility, for applications
that don't need MMAP_FIXED. We've already done this for AC_FUNC_FNMATCH
versus AC_FUNC_FNMATCH_GNU; the former tests only for POSIX
compatibility whereas the latter also tests for GNU compatibility.
The argument for such a change would be stronger if (1) we had a
proposed patch, and (2) the existing AC_FUNC_MMAP was seriously hurting
some applications on some platforms. (Do you have any examples of this
in mind?)