re PR libfortran/21324 (#undef GFC_CLEAR_MEMORY causes testsuite failures)
2005-05-12 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. From-SVN: r99619
This commit is contained in:
parent
7cc70b5e3c
commit
c42a19d5e3
|
@ -1,3 +1,16 @@
|
||||||
|
2005-05-12 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.
|
||||||
|
|
||||||
2005-05-11 Bud Davis <bdavis@gfortran.org>
|
2005-05-11 Bud Davis <bdavis@gfortran.org>
|
||||||
|
|
||||||
PR fortran/19478
|
PR fortran/19478
|
||||||
|
|
|
@ -351,6 +351,7 @@ new_unit (unit_flags * flags)
|
||||||
/* Create the unit structure. */
|
/* Create the unit structure. */
|
||||||
|
|
||||||
u = get_mem (sizeof (gfc_unit) + ioparm.file_len);
|
u = get_mem (sizeof (gfc_unit) + ioparm.file_len);
|
||||||
|
memset (u, '\0', sizeof (gfc_unit) + ioparm.file_len);
|
||||||
|
|
||||||
u->unit_number = ioparm.unit;
|
u->unit_number = ioparm.unit;
|
||||||
u->s = s;
|
u->s = s;
|
||||||
|
|
|
@ -295,6 +295,7 @@ init_units (void)
|
||||||
if (options.stdin_unit >= 0)
|
if (options.stdin_unit >= 0)
|
||||||
{ /* STDIN */
|
{ /* STDIN */
|
||||||
u = get_mem (sizeof (gfc_unit));
|
u = get_mem (sizeof (gfc_unit));
|
||||||
|
memset (u, '\0', sizeof (gfc_unit));
|
||||||
|
|
||||||
u->unit_number = options.stdin_unit;
|
u->unit_number = options.stdin_unit;
|
||||||
u->s = input_stream ();
|
u->s = input_stream ();
|
||||||
|
@ -316,6 +317,7 @@ init_units (void)
|
||||||
if (options.stdout_unit >= 0)
|
if (options.stdout_unit >= 0)
|
||||||
{ /* STDOUT */
|
{ /* STDOUT */
|
||||||
u = get_mem (sizeof (gfc_unit));
|
u = get_mem (sizeof (gfc_unit));
|
||||||
|
memset (u, '\0', sizeof (gfc_unit));
|
||||||
|
|
||||||
u->unit_number = options.stdout_unit;
|
u->unit_number = options.stdout_unit;
|
||||||
u->s = output_stream ();
|
u->s = output_stream ();
|
||||||
|
@ -337,6 +339,7 @@ init_units (void)
|
||||||
if (options.stderr_unit >= 0)
|
if (options.stderr_unit >= 0)
|
||||||
{ /* STDERR */
|
{ /* STDERR */
|
||||||
u = get_mem (sizeof (gfc_unit));
|
u = get_mem (sizeof (gfc_unit));
|
||||||
|
memset (u, '\0', sizeof (gfc_unit));
|
||||||
|
|
||||||
u->unit_number = options.stderr_unit;
|
u->unit_number = options.stderr_unit;
|
||||||
u->s = error_stream ();
|
u->s = error_stream ();
|
||||||
|
|
|
@ -872,6 +872,7 @@ open_internal (char *base, int length)
|
||||||
unix_stream *s;
|
unix_stream *s;
|
||||||
|
|
||||||
s = get_mem (sizeof (unix_stream));
|
s = get_mem (sizeof (unix_stream));
|
||||||
|
memset (s, '\0', sizeof (unix_stream));
|
||||||
|
|
||||||
s->buffer = base;
|
s->buffer = base;
|
||||||
s->buffer_offset = 0;
|
s->buffer_offset = 0;
|
||||||
|
@ -900,6 +901,7 @@ fd_to_stream (int fd, int prot, int avoid_mmap)
|
||||||
unix_stream *s;
|
unix_stream *s;
|
||||||
|
|
||||||
s = get_mem (sizeof (unix_stream));
|
s = get_mem (sizeof (unix_stream));
|
||||||
|
memset (s, '\0', sizeof (unix_stream));
|
||||||
|
|
||||||
s->fd = fd;
|
s->fd = fd;
|
||||||
s->buffer_offset = 0;
|
s->buffer_offset = 0;
|
||||||
|
|
|
@ -36,7 +36,7 @@ Boston, MA 02111-1307, USA. */
|
||||||
return memory that is guaranteed to be set to zero. This can have
|
return memory that is guaranteed to be set to zero. This can have
|
||||||
a severe efficiency penalty, so it should never be set if good
|
a severe efficiency penalty, so it should never be set if good
|
||||||
performance is desired, but it can help when you're debugging code. */
|
performance is desired, but it can help when you're debugging code. */
|
||||||
#define GFC_CLEAR_MEMORY
|
/* #define GFC_CLEAR_MEMORY */
|
||||||
|
|
||||||
/* If GFC_CHECK_MEMORY is defined, we do some sanity checks at runtime.
|
/* If GFC_CHECK_MEMORY is defined, we do some sanity checks at runtime.
|
||||||
This causes small overhead, but again, it also helps debugging. */
|
This causes small overhead, but again, it also helps debugging. */
|
||||||
|
|
Loading…
Reference in New Issue