diff options
author | Barton E. Schaefer <schaefer@zsh.org> | 2017-06-19 16:14:32 -0700 |
---|---|---|
committer | Barton E. Schaefer <schaefer@zsh.org> | 2017-06-19 16:14:32 -0700 |
commit | 9de905b22f7c9c57eef7021ea7737339e5d6d58e (patch) | |
tree | f287c7992872f194c46aa4ceee155992a984b334 | |
parent | a5ed661f256b424a2db60b9dbacadc94fe78d843 (diff) | |
download | zsh-9de905b22f7c9c57eef7021ea7737339e5d6d58e.tar.gz zsh-9de905b22f7c9c57eef7021ea7737339e5d6d58e.tar.xz zsh-9de905b22f7c9c57eef7021ea7737339e5d6d58e.zip |
41322: reduce number of changes in signal queuing/blocking state during shingetline() to improve read speed
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | Src/input.c | 8 |
2 files changed, 8 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog index bff13b443..f79208403 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2017-06-19 Barton E. Schaefer <schaefer@zsh.org> + * 41322 + comment: Src/input.c: reduce number of changes in signal + queuing/blocking state during shingetline() to improve read speed + * 41317: Src/exec.c: use heap allocation in getoutputfile() to plug memory leak diff --git a/Src/input.c b/Src/input.c index 92abaec92..9787dedf6 100644 --- a/Src/input.c +++ b/Src/input.c @@ -144,9 +144,10 @@ shingetline(void) int q = queue_signal_level(); p = buf; + winch_unblock(); + dont_queue_signals(); for (;;) { - winch_unblock(); - dont_queue_signals(); + /* Can't fgets() here because we need to accept '\0' bytes */ do { errno = 0; c = fgetc(bshin); @@ -176,7 +177,8 @@ shingetline(void) ll += p - buf; line[ll] = '\0'; p = buf; - unqueue_signals(); + winch_unblock(); + dont_queue_signals(); } } } |