This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH, libgfortran] PR 56981 Flush buffer at record boundaries
- From: Jerry DeLisle <jvdelisle at charter dot net>
- To: Janne Blomqvist <blomqvist dot janne at gmail dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Fortran List <fortran at gcc dot gnu dot org>
- Date: Sat, 07 Jun 2014 06:38:39 -0700
- Subject: Re: [PATCH, libgfortran] PR 56981 Flush buffer at record boundaries
- Authentication-results: sourceware.org; auth=none
- References: <CAO9iq9EbWpU9YWpYmb17yD_sTpm0+j-HZxxMJhzW75bK6j2rtg at mail dot gmail dot com> <CAO9iq9E9fKdamDpNaDiNWH_Oqj-ADGLK+2edCDZshkMd2UQo=g at mail dot gmail dot com>
On 06/06/2014 07:47 PM, Janne Blomqvist wrote:
> On Tue, May 27, 2014 at 11:50 PM, Janne Blomqvist
> <email@example.com> wrote:
>> the attached patch implements the idea in
>> https://gcc.gnu.org/ml/fortran/2013-04/msg00258.html ; though it
>> turned out it was much simpler than what I envisaged back then. With
>> this patch, we no longer seek back and forth when writing small
>> records with sequential unformatted, which previously happened due to
>> the buffer filling up when not on record boundaries.
>> Performance-wise, I didn't really see any difference on Linux/tmpfs,
>> but maybe it makes a difference in other circumstances. And of course,
>> as a side-effect, it makes sequential unformatted work on unseekable
>> devices such as pipes as long as the records are small, although I'm
>> not sure this is something we want to advertise to users.
>> Regtested on x86_64-unknown-linux-gnu, Ok for trunk?
>> 2014-05-27 Janne Blomqvist <firstname.lastname@example.org>
>> PR libfortran/56981
>> * io/unix.h (struct stream_vtable): Add new member function,
>> (smarkeor): New inline function.
>> (flush_if_unbuffered): Remove prototype.
>> * io/unix.c (raw_markeor): New function.
>> (raw_vtable): Initialize markeor member.
>> (buf_markeor): New function.
>> (buf_vtable): Initialize markeor member.
>> (mem_vtable): Likewise.
>> (mem4_vtable): Likewise.
>> (flush_if_unbuffered): Remove function.
>> * io/transfer.c (next_record): Call smarkeor instead of
>> Janne Blomqvist
OK, thanks for patch.