From c42a19d5e3a8236af3b727cd708bac22a8608b9d Mon Sep 17 00:00:00 2001 From: Thomas Koenig Date: Thu, 12 May 2005 17:50:33 +0000 Subject: re PR libfortran/21324 (#undef GFC_CLEAR_MEMORY causes testsuite failures) 2005-05-12 Thomas Koenig 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 --- libgfortran/io/unit.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libgfortran/io/unit.c') diff --git a/libgfortran/io/unit.c b/libgfortran/io/unit.c index ae0771f..f0d8dbe 100644 --- a/libgfortran/io/unit.c +++ b/libgfortran/io/unit.c @@ -295,6 +295,7 @@ init_units (void) if (options.stdin_unit >= 0) { /* STDIN */ u = get_mem (sizeof (gfc_unit)); + memset (u, '\0', sizeof (gfc_unit)); u->unit_number = options.stdin_unit; u->s = input_stream (); @@ -316,6 +317,7 @@ init_units (void) if (options.stdout_unit >= 0) { /* STDOUT */ u = get_mem (sizeof (gfc_unit)); + memset (u, '\0', sizeof (gfc_unit)); u->unit_number = options.stdout_unit; u->s = output_stream (); @@ -337,6 +339,7 @@ init_units (void) if (options.stderr_unit >= 0) { /* STDERR */ u = get_mem (sizeof (gfc_unit)); + memset (u, '\0', sizeof (gfc_unit)); u->unit_number = options.stderr_unit; u->s = error_stream (); -- cgit v1.1