From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#12327: Signal-handler cleanup for Emacs Date: Sun, 02 Sep 2012 20:51:51 +0300 Message-ID: <83d324fh3c.fsf@gnu.org> References: <50428E57.8070708@cs.ucla.edu> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1346608360 23803 80.91.229.3 (2 Sep 2012 17:52:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 2 Sep 2012 17:52:40 +0000 (UTC) Cc: lekktu@gmail.com, 12327@debbugs.gnu.org To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 02 19:52:41 2012 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 1T8ELh-0000px-IY for geb-bug-gnu-emacs@m.gmane.org; Sun, 02 Sep 2012 19:52:41 +0200 Original-Received: from localhost ([::1]:40732 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8ELe-0000hD-SM for geb-bug-gnu-emacs@m.gmane.org; Sun, 02 Sep 2012 13:52:38 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:42760) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8ELc-0000h2-7L for bug-gnu-emacs@gnu.org; Sun, 02 Sep 2012 13:52:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T8ELb-0007DU-6U for bug-gnu-emacs@gnu.org; Sun, 02 Sep 2012 13:52:36 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53419) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8ELb-0007DP-36 for bug-gnu-emacs@gnu.org; Sun, 02 Sep 2012 13:52:35 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1T8EN0-0000eU-Gg for bug-gnu-emacs@gnu.org; Sun, 02 Sep 2012 13:54:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 02 Sep 2012 17:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12327 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-Cc: lekktu@gmail.com, bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.13466084352492 (code B ref -1); Sun, 02 Sep 2012 17:54:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 2 Sep 2012 17:53:55 +0000 Original-Received: from localhost ([127.0.0.1]:34732 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T8EMt-0000e9-Fd for submit@debbugs.gnu.org; Sun, 02 Sep 2012 13:53:55 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:53747) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T8EMq-0000dz-AV for submit@debbugs.gnu.org; Sun, 02 Sep 2012 13:53:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T8ELP-0007CO-Gx for submit@debbugs.gnu.org; Sun, 02 Sep 2012 13:52:24 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:50290) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8ELP-0007CJ-DI for submit@debbugs.gnu.org; Sun, 02 Sep 2012 13:52:23 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:42710) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8ELO-0000gL-2c for bug-gnu-emacs@gnu.org; Sun, 02 Sep 2012 13:52:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T8ELN-0007Be-1M for bug-gnu-emacs@gnu.org; Sun, 02 Sep 2012 13:52:21 -0400 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:36551) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8ELM-0007BN-P8 for bug-gnu-emacs@gnu.org; Sun, 02 Sep 2012 13:52:20 -0400 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0M9Q00H00HFT5L00@a-mtaout22.012.net.il> for bug-gnu-emacs@gnu.org; Sun, 02 Sep 2012 20:51:46 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M9Q00GRLHMA54G0@a-mtaout22.012.net.il>; Sun, 02 Sep 2012 20:51:46 +0300 (IDT) In-reply-to: <50428E57.8070708@cs.ucla.edu> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:63681 Archived-At: > Date: Sat, 01 Sep 2012 15:38:15 -0700 > From: Paul Eggert > CC: Eli Zaretskii , Juanma Barranquero > > Here's a patch to clean up Emacs's signal-handling code somewhat. > As described below, it shrinks the size of Emacs's text segment > by 0.6% on my platform. It also removes a few dozen lines from > the source code. FWIW, I cannot see any advantage in these changes. They just replace one system of macros by another. The advantage of the current code is that it invokes widely known standard APIs, such as 'signal', 'sigemptyset', and 'sigblock' (never mind that we redefine some of them to call their more modern equivalents: that doesn't impede code reading and understanding in any way). OTOH, the changes you propose replace that with APIs that AFAIK are not known to anyone and, with a couple of exceptions, not used anywhere else. I could go with replacing 'signal' etc. with their modern Posix replacements, such as 'sigaction', directly in the code. That will clean up old APIs while still maintaining clarity for anyone who has ever written signal handlers. But I fail to see any good reasons for changes that, e.g., hide a pair of calls to well-known library functions, such as 'sigemptyset' and 'sigaddset', behind 'sigsetmask' (which AFAIK is a BSD-ism), or behind newly-invented functions such as 'get_sigmask_block_signal'. As for 0.6% reduction in the size of .text: what kind of humongous .text size do you have that makes 0.6% a significant value? On 2 different platforms to which I have access, one of them a x86_64 GNU/Linux, I see ~3.5MB in an unoptimized build and about half that much in an optimized one, which makes the savings around 2KB, too small to justify any change whatsoever. What am I missing?