unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: lekktu@gmail.com, 12327@debbugs.gnu.org
Subject: bug#12327: Signal-handler cleanup for Emacs
Date: Sun, 02 Sep 2012 20:51:51 +0300	[thread overview]
Message-ID: <83d324fh3c.fsf@gnu.org> (raw)
In-Reply-To: <50428E57.8070708@cs.ucla.edu>

> Date: Sat, 01 Sep 2012 15:38:15 -0700
> From: Paul Eggert <eggert@cs.ucla.edu>
> CC: Eli Zaretskii <eliz@gnu.org>, Juanma Barranquero <lekktu@gmail.com>
> 
> 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?





  reply	other threads:[~2012-09-02 17:51 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-01 22:38 bug#12327: Signal-handler cleanup for Emacs Paul Eggert
2012-09-02 17:51 ` Eli Zaretskii [this message]
2012-09-02 18:37   ` Eli Zaretskii
2012-09-02 19:01   ` Paul Eggert
2012-09-02 21:20     ` Eli Zaretskii
2012-09-03  8:16       ` Paul Eggert
2012-09-03  8:49         ` Andreas Schwab
2012-09-03  9:02           ` Paul Eggert
2012-09-03  9:17             ` Andreas Schwab
2012-09-04  8:12               ` Paul Eggert
2012-09-06 11:59                 ` Andy Moreton
2012-09-06 14:41                   ` martin rudalics
2012-09-06 16:46                     ` Eli Zaretskii
2012-09-06 16:54                       ` Andy Moreton
2012-09-06 17:20                         ` Eli Zaretskii
2012-09-06 17:37                       ` martin rudalics
2012-09-03 15:32         ` Eli Zaretskii
2012-09-07  1:35 ` Paul Eggert
2012-09-07  6:02   ` Eli Zaretskii
2012-09-07  7:26     ` Eli Zaretskii
2012-09-07  8:27       ` Eli Zaretskii
2012-09-07  8:59         ` Paul Eggert
2012-09-07 10:21           ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83d324fh3c.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=12327@debbugs.gnu.org \
    --cc=eggert@cs.ucla.edu \
    --cc=lekktu@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).