* alloc.c (mark_buffer): Revert unsafe marking optimization.
[bpt/emacs.git] / src / ChangeLog
index cb4f107..5c9d350 100644 (file)
@@ -1,3 +1,190 @@
+2012-09-07  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * alloc.c (mark_buffer): Revert unsafe marking optimization.
+       (mark_object): Likewise for frame objects.
+
+2012-09-07  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * syssignal.h (handle_on_main_thread): Always declare,
+       even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
+       This ports to platforms without HAVE_PTHREAD.
+
+2012-09-06  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Signal-handler cleanup (Bug#12327).
+       Emacs's signal handlers were written in the old 4.2BSD style with
+       sigblock and sigmask and so forth, and this led to some
+       inefficiencies and confusion.  Rewrite these to use
+       pthread_sigmask etc. without copying signal sets around.  Also,
+       get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
+       'signal', and instead use functions that do not attempt to take
+       over the system name space.  This patch causes Emacs's text
+       segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
+       * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
+       Do not include <signal.h> or "syssignal.h", as these
+       modules do not use signals.
+       * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
+       * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
+       Do not include <signal.h>, as "syssignal.h" does that for us now.
+       * atimer.c (sigmask_atimers): New function.
+       (block_atimers, unblock_atimers): New functions,
+       replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
+       All uses replaced.
+       * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
+       no longer needed here.
+       * emacs.c (main): Inspect existing signal handler with sigaction,
+       so that there's no need to block and unblock SIGHUP.
+       * sysdep.c (struct save_signal): New member 'action', replacing
+       old member 'handler'.
+       (save_signal_handlers, restore_signal_handlers):
+       Use sigaction instead of 'signal' to save and restore.
+       (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
+       New function.  All users of 'signal' modified to use set_sighandler
+       if they're writeonly, and to use sys_signal if they're read+write.
+       (emacs_sigaction_init, forwarded_signal): New functions.
+       (sys_signal): Remove.  All uses replaced by calls to sigaction
+       and emacs_sigaction_init, or by direct calls to 'signal'.
+       (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
+       (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
+       all uses replaced by pthread_sigmask etc. calls.
+       * syssignal.h: Include <signal.h>.
+       (emacs_sigaction_init, forwarded_signal): New decls.
+       (SIGMASKTYPE): Remove.  All uses replaced by its definiens, sigset_t.
+       (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
+       (sigmask, sys_sigmask): Remove; no longer needed.
+       (sigpause): Remove.  All uses replaced by its definiens, sigsuspend.
+       (sigblock, sigunblock, sigfree):
+       (sigsetmask) [!defined sigsetmask]:
+       Remove.  All uses replaced by pthread_sigmask.
+       (signal): Remove.  Its remaining uses (with SIG_DFL and SIG_IGN)
+       no longer need to be replaced, and its typical old uses
+       are now done via emacs_sigaction_init and sigaction.
+       (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
+       (sys_sigdel): Remove; unused.
+       (NSIG): Remove a FIXME; the code's fine.  Remove an unnecessary ifdef.
+
+2012-09-06  Eli Zaretskii  <eliz@gnu.org>
+
+       * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
+       SIGCHLD handling on systems that don't have WNOHANG.  (Bug#12327)
+
+2012-09-06  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       Explicitly mark buffer_defaults and buffer_local_symbols.
+       * alloc.c (Fgarbage_collect): Mark buffer_defaults and
+       mark_local_symbols here.
+       (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
+       since special buffers aren't marked here any more.
+       (allocate_buffer): Chain new buffer with all_buffers here...
+       * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
+       not here.
+       (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
+       (syms_of_buffer): Remove staticpro of the above.
+       (init_buffer_once): Set names for buffer_defaults and
+       buffer_local_symbols.
+
+2012-09-06  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Use bool for booleans in font-related modules.
+       * font.c (font_intern_prop, font_style_to_value)
+       (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
+       (generate_otf_features, font_check_otf_features, font_check_otf)
+       (font_match_p, font_list_entities, font_at):
+       * fontset.c (fontset_id_valid_p, reorder_font_vector
+       (fontset_find_font, Fset_fontset_font)
+       (face_suitable_for_char_p) [0]:
+       * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
+       (ftfont_open, ftfont_text_extents, ftfont_check_otf):
+       (m17n_flt_initialized, ftfont_shape_by_flt):
+       * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
+       * nsfont.m (nsfont_draw):
+       * w32font.c (w32font_draw):
+       * w32term.c (x_draw_glyphless_glyph_string_foreground):
+       Use bool for booleans.
+       * font.h: Adjust to above API changes.
+       (struct font, struct font_driver, struct font_driver_list):
+       Use bool for booleans.
+       (struct font): Remove useless member encoding_type.
+       All users removed.
+       * fontset.c, xftfont.c: Omit unnecessary static decls.
+
+2012-09-06  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * alloc.c (mark_object): Revert window marking code
+       since it's unsafe for the Fset_window_configuration.
+
+2012-09-05  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Fix race conditions with signal handlers and errno (Bug#12327).
+       Be more systematic about preserving errno whenever a signal
+       handler returns, even if it's not in the main thread.  Do this by
+       renaming signal handlers to distinguish between signal delivery
+       and signal handling.  All uses changed.
+       * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
+       * data.c (deliver_arith_signal): Rename from arith_error.
+       * dispnew.c (deliver_window_change_signal): Rename from
+       window_change_signal.
+       * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
+       (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
+       * keyboard.c (deliver_input_available_signal): Rename from
+       input_available_signal.
+       (deliver_user_signal): Rename from handle_user_signal.
+       (deliver_interrupt_signal): Rename from interrupt_signal.
+       * process.c (deliver_pipe_signal): Rename from send_process_trap.
+       (deliver_child_signal): Rename from sigchld_handler.
+       * atimer.c (handle_alarm_signal):
+       * data.c (handle_arith_signal):
+       * dispnew.c (handle_window_change_signal):
+       * emacs.c (handle_fatal_signal, handle_danger_signal):
+       * keyboard.c (handle_input_available_signal):
+       * keyboard.c (handle_user_signal, handle_interrupt_signal):
+       * process.c (handle_pipe_signal, handle_child_signal):
+       New functions, with the actual signal-handling code taken from the
+       original respective signal handlers, sans the sporadic attempts to
+       preserve errno, since that's now done by handle_on_main_thread.
+       * atimer.c (alarm_signal_handler): Remove unnecessary decl.
+       * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
+       * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
+       Move to sysdep.c.
+       (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
+       Move initialization of main_thread to sysdep.c's init_signals.
+       * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
+       our usage, and simplifies the mainline code.
+       (record_child_status_change): New static function, as a helper
+       for handle_child_signal, and with most of the old child handler's
+       contents.
+       (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
+       (handle_child_signal): Use the above.
+       * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
+       Moved here from emacs.c.
+       (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
+       code moved here from emacs.c's main function.
+       * sysdep.c, syssignal.h (handle_on_main_thread): New function,
+       replacing the old SIGNAL_THREAD_CHECK.  All uses changed.  This
+       lets callers save and restore errno properly.
+
+2012-09-05  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       Remove redundant or unused things here and there.
+       * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
+       * conf_post.h (RE_TRANSLATE): Use char_table_translate.
+       * editfns.c (Fcompare_buffer_substrings): Likewise.
+       * frame.h (struct terminal, struct font_driver_list):
+       Remove redundant declarations.
+       * window.h (Qleft, Qright): Likewise.
+
+2012-09-05  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       Do not mark objects from deleted buffers, windows and frames.
+       * alloc.c (mark_buffer): Mark just the buffer if it is dead.
+       (mark_object): Likewise for windows and frames.
+
+2012-09-05  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * alloc.c (valid_lisp_object_p): Treat killed buffers,
+       buffer_defaults and buffer_local_symbols as valid objects.
+       Return special value to denote them.
+
 2012-09-05  Paul Eggert  <eggert@cs.ucla.edu>
 
        * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.