libfortran: Don't zero internally allocated memory (performance issue, PR 21324)
Thomas Koenig
Thomas.Koenig@online.de
Mon May 2 19:51:00 GMT 2005
Hi,
the attached patch makes sure that internally allocated memory
isn't zeroed, which should be a performance win especially for
code which uses array temporaries.
It turned out that some places in the libgfortran library had
to be fixed for this, because they implicitly relied on memory
being allocated. I tested this by changing filling all allocated
with 0xbe, then fixing the resulting breakage (PR 21324) in the
library and running a full regression test on ia64-unknown-linux-gnu
on mainline.
After this, this patch was regression-tested on i686-pc-linux-gnu
on mainline. No testcase, because there was no observable
bug (without this patch) to be fixed by this.
OK to commit?
What do you think about porting this to 4.0?
Thomas
2005-05-02 Thomas Koenig <Thomas.Koenig@online.de>
PR libfortran/21324
* runtime/memory.c: Don't define GFC_CLEAR_MEMORY (it's a
performance hog).
* io/open.c (new_unit): Zero freshly allocated memory for
unit structure.
* io/unit.c (init_units): Zero freshly allocated memory for
STDIN, STDOUT and STDERR.
* io/unix.c (open_internal): Zero freshly allocated memory
for unix_stream.
(fd_to_stream): Likewise.
More information about the Fortran
mailing list