From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ian Kelling Newsgroups: gmane.emacs.bugs Subject: bug#20978: [PATCH 2/7] ; Remove ADAPTIVE_READ_BUFFERING ifdef Date: Sat, 04 Jul 2015 05:40:07 -0700 Message-ID: <87twtkjdug.fsf@iankelling.org> References: <87zj3ckso6.fsf@iankelling.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1436013684 6752 80.91.229.3 (4 Jul 2015 12:41:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 4 Jul 2015 12:41:24 +0000 (UTC) To: 20978@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jul 04 14:41:13 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZBMkp-0005pl-KC for geb-bug-gnu-emacs@m.gmane.org; Sat, 04 Jul 2015 14:41:11 +0200 Original-Received: from localhost ([::1]:44175 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZBMko-0004nC-SY for geb-bug-gnu-emacs@m.gmane.org; Sat, 04 Jul 2015 08:41:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33442) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZBMkl-0004m8-HC for bug-gnu-emacs@gnu.org; Sat, 04 Jul 2015 08:41:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZBMkh-00063o-U2 for bug-gnu-emacs@gnu.org; Sat, 04 Jul 2015 08:41:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:37912) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZBMkh-00063c-QE for bug-gnu-emacs@gnu.org; Sat, 04 Jul 2015 08:41:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZBMkg-0002Au-P8 for bug-gnu-emacs@gnu.org; Sat, 04 Jul 2015 08:41:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <87zj3ckso6.fsf@iankelling.org> Resent-From: Ian Kelling Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 04 Jul 2015 12:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20978 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 20978-submit@debbugs.gnu.org id=B20978.14360136188290 (code B ref 20978); Sat, 04 Jul 2015 12:41:02 +0000 Original-Received: (at 20978) by debbugs.gnu.org; 4 Jul 2015 12:40:18 +0000 Original-Received: from localhost ([127.0.0.1]:39358 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZBMjx-00029a-2S for submit@debbugs.gnu.org; Sat, 04 Jul 2015 08:40:18 -0400 Original-Received: from out5-smtp.messagingengine.com ([66.111.4.29]:53884) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZBMju-00029S-GD for 20978@debbugs.gnu.org; Sat, 04 Jul 2015 08:40:15 -0400 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 4B86920B67; Sat, 4 Jul 2015 08:40:14 -0400 (EDT) Original-Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Sat, 04 Jul 2015 08:40:14 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=iankelling.org; h= content-type:date:from:message-id:mime-version:subject:to :x-sasl-enc:x-sasl-enc; s=mesmtp; bh=STF/2Ly4ft6Khn/6D7YEqVZNAvo =; b=CVm4lCQK+GtnszIY+0Ul0ueYWuGVJNgubCIhmPnaWN2srJ9Yb7+EGJVBTz2 a7f6S0YJuWlyNh3na8SHSa7f34VZiVsQjxSWQdeCMFMhREBDFrwODFWfjNfXlBx8 3zuRVJjlUb/VhkJOv30+C232hDTIVWhwzO7PL0MYb8L+fqAs= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=ST F/2Ly4ft6Khn/6D7YEqVZNAvo=; b=JJ6gz8/wg2T8ZviJVSqAMQshaPyHOZt7uY TSiJWxo/J1fpgCXzUcM+obAoZraH/kwpprGg3H9g/VMnBF53YaFohkZJX3/eZQEO Hh9XfbHPzSKdAKw39OL/mmcOW9KFj3co/UZg6XcmI7vN97m+DhG04jTTuhIym6Ed pv579hL4E= X-Sasl-enc: rZFUWGULZV8P6KnX8crSpJOzA3GwJv8pCmf8JYxAav6I 1436013613 Original-Received: from treetowl.lan (c-73-53-70-213.hsd1.wa.comcast.net [73.53.70.213]) by mail.messagingengine.com (Postfix) with ESMTPA id DDB9BC00288 for <20978@debbugs.gnu.org>; Sat, 4 Jul 2015 08:40:13 -0400 (EDT) Original-Received: by treetowl.lan (Postfix, from userid 1000) id EB5131FE26; Sat, 4 Jul 2015 05:40:07 -0700 (PDT) User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:104684 Archived-At: * src/process.c (make-process, make-pipe-process, deactivate_process) (wait_reading_process_output, read_process_output, send_process) (init_process_emacs): ifdef ADAPTIVE_READ_BUFFERING was originally added in case there was an operating system in which it was not useful. That was 11 years ago and it hasn't happened. Make development easier by not considering the effect of changes on a theoretical OS where this is disabled. diff --git a/src/process.c b/src/process.c index 191f617..1541de2 100644 --- a/src/process.c +++ b/src/process.c @@ -224,11 +224,6 @@ static EMACS_INT update_tick; # define HAVE_SEQPACKET #endif -#if !defined (ADAPTIVE_READ_BUFFERING) && !defined (NO_ADAPTIVE_READ_BUFFERING) -#define ADAPTIVE_READ_BUFFERING -#endif - -#ifdef ADAPTIVE_READ_BUFFERING #define READ_OUTPUT_DELAY_INCREMENT (TIMESPEC_RESOLUTION / 100) #define READ_OUTPUT_DELAY_MAX (READ_OUTPUT_DELAY_INCREMENT * 5) #define READ_OUTPUT_DELAY_MAX_MAX (READ_OUTPUT_DELAY_INCREMENT * 7) @@ -242,10 +237,6 @@ static int process_output_delay_count; static bool process_output_skip; -#else -#define process_output_delay_count 0 -#endif - static void create_process (Lisp_Object, char **, Lisp_Object); #ifdef USABLE_SIGIO static bool keyboard_bit_set (fd_set *); @@ -1517,11 +1508,9 @@ usage: (make-process &rest ARGS) */) pset_gnutls_cred_type (XPROCESS (proc), Qnil); #endif -#ifdef ADAPTIVE_READ_BUFFERING XPROCESS (proc)->adaptive_read_buffering = (NILP (Vprocess_adaptive_read_buffering) ? 0 : EQ (Vprocess_adaptive_read_buffering, Qt) ? 1 : 2); -#endif /* Make the process marker point into the process buffer (if any). */ if (BUFFERP (buffer)) @@ -2184,11 +2173,9 @@ usage: (make-pipe-process &rest ARGS) */) FD_SET (inchannel, &input_wait_mask); FD_SET (inchannel, &non_keyboard_wait_mask); } -#ifdef ADAPTIVE_READ_BUFFERING p->adaptive_read_buffering = (NILP (Vprocess_adaptive_read_buffering) ? 0 : EQ (Vprocess_adaptive_read_buffering, Qt) ? 1 : 2); -#endif /* Make the process marker point into the process buffer (if any). */ if (BUFFERP (buffer)) @@ -4183,7 +4170,6 @@ deactivate_process (Lisp_Object proc) emacs_gnutls_deinit (proc); #endif /* HAVE_GNUTLS */ -#ifdef ADAPTIVE_READ_BUFFERING if (p->read_output_delay > 0) { if (--process_output_delay_count < 0) @@ -4191,7 +4177,6 @@ deactivate_process (Lisp_Object proc) p->read_output_delay = 0; p->read_output_skip = 0; } -#endif /* Beware SIGCHLD hereabouts. */ @@ -4876,7 +4861,6 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, else { -#ifdef ADAPTIVE_READ_BUFFERING /* Set the timeout for adaptive read buffering if any process has non-zero read_output_skip and non-zero read_output_delay, and we are not reading output for a @@ -4908,7 +4892,6 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, timeout = make_timespec (0, nsecs); process_output_skip = 0; } -#endif #if defined (HAVE_NS) nfds = ns_select @@ -5345,7 +5328,6 @@ read_process_output (Lisp_Object proc, int channel) #endif nbytes = emacs_read (channel, chars + carryover + buffered, readmax - buffered); -#ifdef ADAPTIVE_READ_BUFFERING if (nbytes > 0 && p->adaptive_read_buffering) { int delay = p->read_output_delay; @@ -5371,7 +5353,6 @@ read_process_output (Lisp_Object proc, int channel) process_output_skip = 1; } } -#endif nbytes += buffered; nbytes += buffered && nbytes <= 0; } @@ -5840,7 +5821,6 @@ send_process (Lisp_Object proc, const char *buf, ptrdiff_t len, #endif written = emacs_write_sig (outfd, cur_buf, cur_len); rv = (written ? 0 : -1); -#ifdef ADAPTIVE_READ_BUFFERING if (p->read_output_delay > 0 && p->adaptive_read_buffering == 1) { @@ -5848,7 +5828,6 @@ send_process (Lisp_Object proc, const char *buf, ptrdiff_t len, process_output_delay_count--; p->read_output_skip = 0; } -#endif } if (rv < 0) @@ -7470,10 +7449,8 @@ init_process_emacs (void) num_pending_connects = 0; #endif -#ifdef ADAPTIVE_READ_BUFFERING process_output_delay_count = 0; process_output_skip = 0; -#endif /* Don't do this, it caused infinite select loops. The display method should call add_keyboard_wait_descriptor on stdin if it @@ -7638,7 +7615,6 @@ then a pipe is used in any case. The value takes effect when `start-process' is called. */); Vprocess_connection_type = Qt; -#ifdef ADAPTIVE_READ_BUFFERING DEFVAR_LISP ("process-adaptive-read-buffering", Vprocess_adaptive_read_buffering, doc: /* If non-nil, improve receive buffering by delaying after short reads. On some systems, when Emacs reads the output from a subprocess, the output data @@ -7650,7 +7626,6 @@ If the value is t, the delay is reset after each write to the process; any other non-nil value means that the delay is not reset on write. The variable takes effect when `start-process' is called. */); Vprocess_adaptive_read_buffering = Qt; -#endif defsubr (&Sprocessp); defsubr (&Sget_process); -- 2.4.5