summaryrefslogtreecommitdiff
path: root/libgfortran/runtime
diff options
context:
space:
mode:
authorThomas Koenig <tkoenig@gcc.gnu.org>2019-07-21 15:55:49 +0000
committerThomas Koenig <tkoenig@gcc.gnu.org>2019-07-21 15:55:49 +0000
commitc37b0163fe5307ab508489926114de9cf7e240c1 (patch)
tree205699e71034f0bc8b7603c02225124f390c4073 /libgfortran/runtime
parent037455d49c2c19521bf60253c098d0e1e48d68fa (diff)
downloadgcc-c37b0163fe5307ab508489926114de9cf7e240c1.tar.gz
re PR libfortran/91030 (Poor performance of I/O -fconvert=big-endian)
2019-07-21 Thomas König <tkoenig@gcc.gnu.org> PR libfortran/91030 * gfortran.texi (GFORTRAN_FORMATTED_BUFFER_SIZE): Document (GFORTRAN_UNFORMATTED_BUFFER_SIZE): Likewise. 2019-07-21 Thomas König <tkoenig@gcc.gnu.org> PR libfortran/91030 * io/unix.c (BUFFER_SIZE): Delete. (BUFFER_FORMATTED_SIZE_DEFAULT): New variable. (BUFFER_UNFORMATTED_SIZE_DEFAULT): New variable. (unix_stream): Add buffer_size. (buf_read): Use s->buffer_size instead of BUFFER_SIZE. (buf_write): Likewise. (buf_init): Add argument unformatted. Handle block sizes for unformatted vs. formatted, using defaults if provided. (fd_to_stream): Add argument unformatted in call to buf_init. * libgfortran.h (options_t): Add buffer_size_formatted and buffer_size_unformatted. * runtime/environ.c (variable_table): Add GFORTRAN_UNFORMATTED_BUFFER_SIZE and GFORTRAN_FORMATTED_BUFFER_SIZE. From-SVN: r273643
Diffstat (limited to 'libgfortran/runtime')
-rw-r--r--libgfortran/runtime/environ.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libgfortran/runtime/environ.c b/libgfortran/runtime/environ.c
index e3e7d2499d7..5817d199799 100644
--- a/libgfortran/runtime/environ.c
+++ b/libgfortran/runtime/environ.c
@@ -198,6 +198,14 @@ static variable variable_table[] = {
/* Print out a backtrace if possible on runtime error */
{ "GFORTRAN_ERROR_BACKTRACE", -1, &options.backtrace, init_boolean },
+ /* Buffer size for unformatted files. */
+ { "GFORTRAN_UNFORMATTED_BUFFER_SIZE", 0, &options.unformatted_buffer_size,
+ init_integer },
+
+ /* Buffer size for formatted files. */
+ { "GFORTRAN_FORMATTED_BUFFER_SIZE", 0, &options.formatted_buffer_size,
+ init_integer },
+
{ NULL, 0, NULL, NULL }
};