[ruby-cvs:55328] normal:r48178 (trunk): signal.c: avoid repeated disable/enable interrupt

normal at ruby-lang.org normal at ruby-lang.org
Wed Oct 29 03:39:47 JST 2014


normal	2014-10-29 03:39:45 +0900 (Wed, 29 Oct 2014)

  New Revision: 48178

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=48178

  Log:
    signal.c: avoid repeated disable/enable interrupt
    
    We only install system-level signal handlers during init (before any
    threads or user code is running), so there's no need to repeatedly
    enable/disable the interrupts at that time.  We also do not change
    system-level sig handlers once user-level code is running.
    
    This saves about 20 syscalls at startup and makes the executable
    smaller (numbers from 32-bit x86):
    
            text       data     bss     dec     hex filename
    before: 2815726   12100   30552 2858378  2b9d8a ruby
     after: 2815022   12100   30552 2857674  2b9aca ruby
    
    * signal.c (install_sighandler): remove rb_disable_interrupt and
      rb_enable_interrupt calls
      (init_sigchld): ditto
      (Init_signal): disable and enable interrupt once around all
      install_sighandler and init_sigchld to reduce syscalls at start
      [Feature #9345] [ruby-core:59480]

  Modified files:
    trunk/ChangeLog
    trunk/signal.c


More information about the ruby-cvs mailing list