This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: A sick idea - mmapped file output
- To: Michael Matz <matzmich at cs dot tu-berlin dot de>
- Subject: Re: A sick idea - mmapped file output
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Sun, 05 Nov 2000 19:29:19 -0700
- cc: Zack Weinberg <zackw at stanford dot edu>, gcc at gcc dot gnu dot org
- Reply-To: law at redhat dot com
In message <Pine.GSO.4.21.0011030702120.19361-100000@platon>you write:
> Hi,
>
> On Thu, 2 Nov 2000, Zack Weinberg wrote:
> >
> > However, you can anticipate running off the end and extend the file
> > with ftruncate. POSIX and SUS don't guarantee that this works, but
> > assuming it does, this is indeed faster than write(2) - until you run
> > out of mapping, at which point you have a problem. Or, even cleverer,
> > you can catch the signal and extend it then, but this doesn't seem to
> > be any faster than anticipating the end (not surprising; signals ain't
> > cheap).
>
> Hmm, although it's not really clear if there is a benefit in real
> situations (like compiling a program with optimizations ;-) ), there is
> also not a real reason why we shouldn't do it if we can (and the system
> supports it).
I disagree strongly.
What Zack is effectively proposing is that we code to specific features
of implementations instead of a standard. ie, if the spec doesn't spell
this out as defined behavior, then we should not use it.
Furthermore, this should not be a long term issue since we hopefully
won't be doing IO.
jeff