------------------------------------------------------------ revno: 117202 committer: Dmitry Antipov branch nick: trunk timestamp: Fri 2014-05-30 11:40:29 +0400 message: Debugging facility to check whether 'const char *' points to relocatable data of non-pure Lisp string. * alloc.c (maybe_lisp_pointer): New function, refactored out of ... (mark_maybe_pointer): ... adjusted user. (relocatable_string_data_p): New function. * lisp.h (relocatable_string_data_p): Add prototype. * xdisp.c (message_with_string): If ENABLE_CHECKING, make sure the pointer to relocatable Lisp data is not used. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-05-30 04:12:08 +0000 +++ src/ChangeLog 2014-05-30 07:40:29 +0000 @@ -1,3 +1,14 @@ +2014-05-30 Dmitry Antipov + + Debugging facility to check whether 'const char *' points to + relocatable data of non-pure Lisp string. + * alloc.c (maybe_lisp_pointer): New function, refactored out of ... + (mark_maybe_pointer): ... adjusted user. + (relocatable_string_data_p): New function. + * lisp.h (relocatable_string_data_p): Add prototype. + * xdisp.c (message_with_string): If ENABLE_CHECKING, make sure + the pointer to relocatable Lisp data is not used. + 2014-05-30 Paul Eggert Don't let SIGINT handling block SIGCHLD indefinitely (Bug#17561). === modified file 'src/alloc.c' --- src/alloc.c 2014-05-29 08:02:58 +0000 +++ src/alloc.c 2014-05-30 07:40:29 +0000 @@ -4547,7 +4547,16 @@ } } +/* Return true if P can point to Lisp data, and false otherwise. + USE_LSB_TAG needs Lisp data to be aligned on multiples of GCALIGNMENT. + Otherwise, assume that Lisp data is aligned on even addresses. */ +static bool +maybe_lisp_pointer (void *p) +{ + return !((intptr_t) p % (USE_LSB_TAG ? GCALIGNMENT : 2)); +} + /* If P points to Lisp data, mark that as live if it isn't already marked. */ @@ -4561,10 +4570,7 @@ VALGRIND_MAKE_MEM_DEFINED (&p, sizeof (p)); #endif - /* Quickly rule out some values which can't point to Lisp data. - USE_LSB_TAG needs Lisp data to be aligned on multiples of GCALIGNMENT. - Otherwise, assume that Lisp data is aligned on even addresses. */ - if ((intptr_t) p % (USE_LSB_TAG ? GCALIGNMENT : 2)) + if (!maybe_lisp_pointer (p)) return; m = mem_find (p); @@ -5007,9 +5013,34 @@ #endif } - - - +/* If GC_MARK_STACK, return 1 if STR is a relocatable data of Lisp_String + (i.e. there is a non-pure Lisp_Object X so that SDATA (X) == STR) and 0 + if not. Otherwise we can't rely on valid_lisp_object_p and return -1. + This function is slow and should be used for debugging purposes. */ + +int +relocatable_string_data_p (const char *str) +{ + if (PURE_POINTER_P (str)) + return 0; +#if GC_MARK_STACK + if (str) + { + struct sdata *sdata + = (struct sdata *) (str - offsetof (struct sdata, data)); + + if (valid_pointer_p (sdata) + && valid_pointer_p (sdata->string) + && maybe_lisp_pointer (sdata->string)) + return (valid_lisp_object_p + (make_lisp_ptr (sdata->string, Lisp_String)) + && (const char *) sdata->string->data == str); + } + return 0; +#endif /* GC_MARK_STACK */ + return -1; +} + /*********************************************************************** Pure Storage Management ***********************************************************************/ === modified file 'src/lisp.h' --- src/lisp.h 2014-05-29 14:52:47 +0000 +++ src/lisp.h 2014-05-30 07:40:29 +0000 @@ -3747,6 +3747,7 @@ extern void syms_of_alloc (void); extern struct buffer * allocate_buffer (void); extern int valid_lisp_object_p (Lisp_Object); +extern int relocatable_string_data_p (const char *); #ifdef GC_CHECK_CONS_LIST extern void check_cons_list (void); #else === modified file 'src/xdisp.c' --- src/xdisp.c 2014-05-26 02:28:09 +0000 +++ src/xdisp.c 2014-05-30 07:40:29 +0000 @@ -10201,19 +10201,17 @@ { if (m) { - /* ENCODE_SYSTEM below can GC and/or relocate the Lisp - String whose data pointer might be passed to us in M. So - we use a local copy. */ - char *fmt = xstrdup (m); + /* ENCODE_SYSTEM below can GC and/or relocate the + Lisp data, so make sure we don't use it here. */ + eassert (relocatable_string_data_p (m) != 1); if (noninteractive_need_newline) putc ('\n', stderr); noninteractive_need_newline = 0; - fprintf (stderr, fmt, SDATA (ENCODE_SYSTEM (string))); + fprintf (stderr, m, SDATA (ENCODE_SYSTEM (string))); if (!cursor_in_echo_area) fprintf (stderr, "\n"); fflush (stderr); - xfree (fmt); } } else if (INTERACTIVE) ------------------------------------------------------------ revno: 117201 fixes bug: http://debbugs.gnu.org/17561 committer: Paul Eggert branch nick: trunk timestamp: Thu 2014-05-29 21:12:08 -0700 message: Don't let SIGINT handling block SIGCHLD indefinitely. * atimer.c (block_atimers): * callproc.c (block_child_signal): Block SIGINT too; otherwise, its handler might now unblock signals that it shouldn't. * keyboard.c (read_char): Clear signal mask, since we may be in a SIGINT handler, and many signals may be masked. * keyboard.c (handle_interrupt): * sysdep.c (handle_arith_signal): Clear signal mask instead of just unblocking the signal that was received, since several signals may be blocked at this point. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-05-29 19:16:32 +0000 +++ src/ChangeLog 2014-05-30 04:12:08 +0000 @@ -1,3 +1,16 @@ +2014-05-30 Paul Eggert + + Don't let SIGINT handling block SIGCHLD indefinitely (Bug#17561). + * atimer.c (block_atimers): + * callproc.c (block_child_signal): Block SIGINT too; + otherwise, its handler might now unblock signals that it shouldn't. + * keyboard.c (read_char): Clear signal mask, since we may + be in a SIGINT handler, and many signals may be masked. + * keyboard.c (handle_interrupt): + * sysdep.c (handle_arith_signal): + Clear signal mask instead of just unblocking the signal that + was received, since several signals may be blocked at this point. + 2014-05-29 Eli Zaretskii * Makefile.in (TEMACS_POST_LINK): Remove target. === modified file 'src/atimer.c' --- src/atimer.c 2014-03-25 14:43:26 +0000 +++ src/atimer.c 2014-05-30 04:12:08 +0000 @@ -55,6 +55,7 @@ sigset_t blocked; sigemptyset (&blocked); sigaddset (&blocked, SIGALRM); + sigaddset (&blocked, SIGINT); pthread_sigmask (SIG_BLOCK, &blocked, oldset); } static void @@ -404,7 +405,6 @@ void init_atimer (void) { - struct sigaction action; #ifdef HAVE_ITIMERSPEC struct sigevent sigev; sigev.sigev_notify = SIGEV_SIGNAL; @@ -413,7 +413,9 @@ alarm_timer_ok = timer_create (CLOCK_REALTIME, &sigev, &alarm_timer) == 0; #endif free_atimers = stopped_atimers = atimers = NULL; - /* pending_signals is initialized in init_keyboard.*/ + + /* pending_signals is initialized in init_keyboard. */ + struct sigaction action; emacs_sigaction_init (&action, handle_alarm_signal); sigaction (SIGALRM, &action, 0); } === modified file 'src/callproc.c' --- src/callproc.c 2014-04-16 19:43:46 +0000 +++ src/callproc.c 2014-05-30 04:12:08 +0000 @@ -115,6 +115,7 @@ sigset_t blocked; sigemptyset (&blocked); sigaddset (&blocked, SIGCHLD); + sigaddset (&blocked, SIGINT); pthread_sigmask (SIG_BLOCK, &blocked, oldset); } === modified file 'src/keyboard.c' --- src/keyboard.c 2014-05-28 08:00:10 +0000 +++ src/keyboard.c 2014-05-30 04:12:08 +0000 @@ -2664,6 +2664,7 @@ /* We must have saved the outer value of getcjmp here, so restore it now. */ restore_getcjmp (save_jump); + pthread_sigmask (SIG_SETMASK, &empty_mask, 0); unbind_to (jmpcount, Qnil); XSETINT (c, quit_char); internal_last_event_frame = selected_frame; @@ -10323,9 +10324,6 @@ handle_interrupt (bool in_signal_handler) { char c; - sigset_t blocked; - sigemptyset (&blocked); - sigaddset (&blocked, SIGINT); cancel_echoing (); @@ -10337,6 +10335,9 @@ /* If SIGINT isn't blocked, don't let us be interrupted by a SIGINT. It might be harmful due to non-reentrancy in I/O functions. */ + sigset_t blocked; + sigemptyset (&blocked); + sigaddset (&blocked, SIGINT); pthread_sigmask (SIG_BLOCK, &blocked, 0); } @@ -10421,7 +10422,7 @@ struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; immediate_quit = 0; - pthread_sigmask (SIG_UNBLOCK, &blocked, 0); + pthread_sigmask (SIG_SETMASK, &empty_mask, 0); saved = gl_state; GCPRO4 (saved.object, saved.global_code, saved.current_syntax_table, saved.old_prop); @@ -10442,7 +10443,7 @@ } } - pthread_sigmask (SIG_UNBLOCK, &blocked, 0); + pthread_sigmask (SIG_SETMASK, &empty_mask, 0); /* TODO: The longjmp in this call throws the NS event loop integration off, and it seems to do fine without this. Probably some attention === modified file 'src/sysdep.c' --- src/sysdep.c 2014-04-16 19:43:46 +0000 +++ src/sysdep.c 2014-05-30 04:12:08 +0000 @@ -1645,10 +1645,7 @@ static _Noreturn void handle_arith_signal (int sig) { - sigset_t blocked; - sigemptyset (&blocked); - sigaddset (&blocked, sig); - pthread_sigmask (SIG_UNBLOCK, &blocked, 0); + pthread_sigmask (SIG_SETMASK, &empty_mask, 0); xsignal0 (Qarith_error); } ------------------------------------------------------------ revno: 117200 fixes bug: http://debbugs.gnu.org/17561 committer: Paul Eggert branch nick: trunk timestamp: Thu 2014-05-29 16:13:32 -0700 message: * configure.ac (pthread_sigmask): Look in LIB_PTHREAD too. Fixes configuration glitch found in . diff: === modified file 'ChangeLog' --- ChangeLog 2014-05-29 19:16:32 +0000 +++ ChangeLog 2014-05-29 23:13:32 +0000 @@ -1,3 +1,8 @@ +2014-05-29 Paul Eggert + + * configure.ac (pthread_sigmask): Look in LIB_PTHREAD too (Bug#17561). + Fixes configuration glitch found in . + 2014-05-29 Eli Zaretskii * configure.ac (ADDSECTION, TEMACS_POST_LINK): Don't compute, === modified file 'configure.ac' --- configure.ac 2014-05-29 19:16:32 +0000 +++ configure.ac 2014-05-29 23:13:32 +0000 @@ -3470,13 +3470,13 @@ AC_SUBST(BLESSMAIL_TARGET) OLD_LIBS=$LIBS -LIBS="$LIB_MATH $LIBS" +LIBS="$LIB_PTHREAD $LIB_MATH $LIBS" AC_CHECK_FUNCS(accept4 gethostname \ getrusage get_current_dir_name \ lrand48 random rint \ select getpagesize setlocale \ getrlimit setrlimit shutdown getaddrinfo \ -strsignal setitimer \ +pthread_sigmask strsignal setitimer \ sendto recvfrom getsockname getpeername getifaddrs freeifaddrs \ gai_strerror sync \ getpwent endpwent getgrent endgrent \ ------------------------------------------------------------ revno: 117199 committer: Reuben Thomas branch nick: trunk timestamp: Thu 2014-05-29 23:51:47 +0100 message: Improve non-interactive use of whitespace reporting whitespace.el (whitespace-report-region): Allow report-if-bogus to take the value `never', for non-interactive use. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-05-29 22:43:26 +0000 +++ lisp/ChangeLog 2014-05-29 22:51:47 +0000 @@ -2,6 +2,8 @@ * whitespace.el (whitespace-report-region): Simplify documentation. + (whitespace-report-region): Allow report-if-bogus to take the + value `never', for non-interactive use. (whitespace-report): Refer to whitespace-report-region's documentation. === modified file 'lisp/whitespace.el' --- lisp/whitespace.el 2014-05-29 22:43:26 +0000 +++ lisp/whitespace.el 2014-05-29 22:51:47 +0000 @@ -1737,13 +1737,14 @@ forces `whitespace-style' to have: empty + trailing indentation space-before-tab - trailing space-after-tab -If REPORT-IF-BOGUS is non-nil, it reports only when there are any -whitespace problems in buffer. +If REPORT-IF-BOGUS is t, it reports only when there are any +whitespace problems in buffer; if it is `never', it does not +report problems. Report if some of the following whitespace problems exist: @@ -1798,7 +1799,7 @@ (and (re-search-forward regexp rend t) (setq has-bogus t)))) whitespace-report-list))) - (when (if report-if-bogus has-bogus t) + (when (pcase report-if-bogus (`nil t) (`never nil) (_ has-bogus)) (whitespace-kill-buffer whitespace-report-buffer-name) ;; `whitespace-indent-tabs-mode' is local to current buffer ;; `whitespace-tab-width' is local to current buffer ------------------------------------------------------------ revno: 117198 committer: Reuben Thomas branch nick: trunk timestamp: Thu 2014-05-29 23:43:26 +0100 message: Improve documentation for whitespace-report{,-region} * whitespace.el (whitespace-report-region): Simplify documentation. (whitespace-report): Refer to whitespace-report-region's documentation. This commit message also covers the previous commit, which was erroneously committed with the log message "."; sorry. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-05-29 22:38:02 +0000 +++ lisp/ChangeLog 2014-05-29 22:43:26 +0000 @@ -1,6 +1,9 @@ 2014-05-29 Reuben Thomas - * whitespace.el (whitespace-report): Simplify documentation. + * whitespace.el (whitespace-report-region): Simplify + documentation. + (whitespace-report): Refer to whitespace-report-region's + documentation. 2014-05-29 Stefan Monnier === modified file 'lisp/whitespace.el' --- lisp/whitespace.el 2014-05-29 22:38:02 +0000 +++ lisp/whitespace.el 2014-05-29 22:43:26 +0000 @@ -1719,36 +1719,7 @@ (defun whitespace-report (&optional force report-if-bogus) "Report some whitespace problems in buffer. -Return nil if there is no whitespace problem; otherwise, return -non-nil. - -If FORCE is non-nil or \\[universal-argument] was pressed just -before calling `whitespace-report' interactively, it forces -`whitespace-style' to have: - - empty - trailing - indentation - space-before-tab - space-after-tab - -If REPORT-IF-BOGUS is non-nil, it reports only when there are any -whitespace problems in buffer. - -Report if some of the following whitespace problems exist: - - empty 1. empty lines at beginning of buffer. - empty 2. empty lines at end of buffer. - trailing 3. SPACEs or TABs at end of line. - space-before-tab 4. SPACEs before TAB. - space-after-tab 5. 8 or more SPACEs after TAB. - indentation 6. If `indent-tabs-mode': - 8 or more SPACEs at beginning of line - else: TABS at beginning of line. - -See `whitespace-style' for documentation. -See also `whitespace-cleanup' and `whitespace-cleanup-region' for -cleaning up these problems." +Perform `whitespace-report-region' on the current buffer." (interactive (list current-prefix-arg)) (whitespace-report-region (point-min) (point-max) force report-if-bogus)) ------------------------------------------------------------ revno: 117197 committer: Reuben Thomas branch nick: trunk timestamp: Thu 2014-05-29 23:38:02 +0100 message: . diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-05-29 03:54:37 +0000 +++ lisp/ChangeLog 2014-05-29 22:38:02 +0000 @@ -1,3 +1,7 @@ +2014-05-29 Reuben Thomas + + * whitespace.el (whitespace-report): Simplify documentation. + 2014-05-29 Stefan Monnier * whitespace.el: Use font-lock-flush. Minimize refontifications. === modified file 'lisp/whitespace.el' --- lisp/whitespace.el 2014-05-29 03:54:37 +0000 +++ lisp/whitespace.el 2014-05-29 22:38:02 +0000 @@ -1737,21 +1737,14 @@ Report if some of the following whitespace problems exist: -* If `indent-tabs-mode' is non-nil: - empty 1. empty lines at beginning of buffer. - empty 2. empty lines at end of buffer. - trailing 3. SPACEs or TABs at end of line. - indentation 4. 8 or more SPACEs at beginning of line. - space-before-tab 5. SPACEs before TAB. - space-after-tab 6. 8 or more SPACEs after TAB. - -* If `indent-tabs-mode' is nil: - empty 1. empty lines at beginning of buffer. - empty 2. empty lines at end of buffer. - trailing 3. SPACEs or TABs at end of line. - indentation 4. TABS at beginning of line. - space-before-tab 5. SPACEs before TAB. - space-after-tab 6. 8 or more SPACEs after TAB. + empty 1. empty lines at beginning of buffer. + empty 2. empty lines at end of buffer. + trailing 3. SPACEs or TABs at end of line. + space-before-tab 4. SPACEs before TAB. + space-after-tab 5. 8 or more SPACEs after TAB. + indentation 6. If `indent-tabs-mode': + 8 or more SPACEs at beginning of line + else: TABS at beginning of line. See `whitespace-style' for documentation. See also `whitespace-cleanup' and `whitespace-cleanup-region' for ------------------------------------------------------------ revno: 117196 committer: Paul Eggert branch nick: trunk timestamp: Thu 2014-05-29 15:24:49 -0700 message: Don't imply that `quoting' is required. diff: === modified file 'admin/notes/changelogs' --- admin/notes/changelogs 2014-05-29 19:49:45 +0000 +++ admin/notes/changelogs 2014-05-29 22:24:49 +0000 @@ -1,8 +1,8 @@ Emacs generally follows the GNU coding standards when it comes to ChangeLogs: http://www.gnu.org/prep/standards/html_node/Change-Logs.html -One exception is that we still quote `like-this' (as the standards -used to recommend) rather than 'like-this' (as they do now), +One exception is that we still sometimes quote `like-this' (as the +standards used to recommend) rather than 'like-this' (as they do now), because `...' is so widely used elsewhere in Emacs. http://lists.gnu.org/archive/html/emacs-devel/2014-05/msg00514.html ------------------------------------------------------------ revno: 117195 committer: Glenn Morris branch nick: trunk timestamp: Thu 2014-05-29 15:49:45 -0400 message: * admin/notes/changelogs: Mention `quoting'. diff: === modified file 'admin/notes/changelogs' --- admin/notes/changelogs 2013-07-11 16:15:57 +0000 +++ admin/notes/changelogs 2014-05-29 19:49:45 +0000 @@ -1,3 +1,12 @@ +Emacs generally follows the GNU coding standards when it comes to ChangeLogs: +http://www.gnu.org/prep/standards/html_node/Change-Logs.html + +One exception is that we still quote `like-this' (as the standards +used to recommend) rather than 'like-this' (as they do now), +because `...' is so widely used elsewhere in Emacs. +http://lists.gnu.org/archive/html/emacs-devel/2014-05/msg00514.html + + If installing changes written by someone else, make the ChangeLog entry in their name, not yours. ------------------------------------------------------------ revno: 117194 committer: Eli Zaretskii branch nick: trunk timestamp: Thu 2014-05-29 22:19:18 +0300 message: nt/ChangeLog: Fix last entry. diff: === modified file 'nt/ChangeLog' --- nt/ChangeLog 2014-05-29 19:16:32 +0000 +++ nt/ChangeLog 2014-05-29 19:19:18 +0000 @@ -3,6 +3,8 @@ * Makefile.in (DONT_INSTALL): Now empty. (addsection${EXEEXT}): Remove target. + * addsection.c: File removed. + 2014-05-27 Fabrice Popineau * inc/ms-w32.h: Switch to the system heap allocation scheme ------------------------------------------------------------ revno: 117193 committer: Eli Zaretskii branch nick: trunk timestamp: Thu 2014-05-29 22:16:32 +0300 message: Remove nt/addsection.c and don't build addsection.exe. configure.ac (ADDSECTION, TEMACS_POST_LINK): Don't compute, unused. nt/Makefile.in (DONT_INSTALL): Now empty. (addsection${EXEEXT}): Remove target. nt/addsection.c: File removed. src/Makefile.in (TEMACS_POST_LINK): Remove target. (emacs$(EXEEXT)): Remove $(ADDSECTION) from prerequisites. (temacs$(EXEEXT)): Remove $(TEMACS_POST_LINK) from the recipe. diff: === modified file 'ChangeLog' --- ChangeLog 2014-05-29 15:05:06 +0000 +++ ChangeLog 2014-05-29 19:16:32 +0000 @@ -1,3 +1,8 @@ +2014-05-29 Eli Zaretskii + + * configure.ac (ADDSECTION, TEMACS_POST_LINK): Don't compute, + unused. + 2014-05-29 Paul Eggert Don't substitute sigprocmask for pthread_sigmask (Bug#17561). === modified file 'configure.ac' --- configure.ac 2014-05-29 15:05:06 +0000 +++ configure.ac 2014-05-29 19:16:32 +0000 @@ -4835,13 +4835,9 @@ AC_SUBST(LD_SWITCH_SYSTEM_TEMACS) -## MinGW-specific post-link processing of temacs. -TEMACS_POST_LINK=":" -ADDSECTION= +## MinGW-specific compilation switch. C_HEAP_SWITCH= if test "${opsys}" = "mingw32"; then - TEMACS_POST_LINK="\$(MINGW_TEMACS_POST_LINK)" - ADDSECTION="../nt/addsection\$(EXEEXT)" ## Preload heap size of temacs.exe in MB. case "$canonical" in x86_64-*-*) C_HEAP_SWITCH="-DHEAPSIZE=18" ;; @@ -4849,8 +4845,6 @@ esac fi -AC_SUBST(ADDSECTION) -AC_SUBST(TEMACS_POST_LINK) AC_SUBST(C_HEAP_SWITCH) ## Common for all window systems === modified file 'nt/ChangeLog' --- nt/ChangeLog 2014-05-27 17:31:17 +0000 +++ nt/ChangeLog 2014-05-29 19:16:32 +0000 @@ -1,3 +1,8 @@ +2014-05-29 Eli Zaretskii + + * Makefile.in (DONT_INSTALL): Now empty. + (addsection${EXEEXT}): Remove target. + 2014-05-27 Fabrice Popineau * inc/ms-w32.h: Switch to the system heap allocation scheme === modified file 'nt/Makefile.in' --- nt/Makefile.in 2014-02-17 19:04:51 +0000 +++ nt/Makefile.in 2014-05-29 19:16:32 +0000 @@ -120,7 +120,7 @@ UTILITIES = cmdproxy${EXEEXT} ddeclient${EXEEXT} # Things that Emacs runs during the build process. -DONT_INSTALL = addsection${EXEEXT} +DONT_INSTALL = # All files that are created by the linker, i.e., whose names end in ${EXEEXT}. EXE_FILES = ${INSTALLABLES} ${UTILITIES} ${DONT_INSTALL} @@ -208,9 +208,6 @@ ../lib-src/etags *.[ch] ## Build the programs -addsection${EXEEXT}: ${srcdir}/addsection.c - $(CC) ${ALL_CFLAGS} ${srcdir}/addsection.c -o addsection${EXEEXT} - addpm${EXEEXT}: ${srcdir}/addpm.c ../src/epaths.h $(CC) ${ALL_CFLAGS} ${srcdir}/addpm.c $(LIBS_ADDPM) -o addpm${EXEEXT} === removed file 'nt/addsection.c' --- nt/addsection.c 2014-01-01 07:43:34 +0000 +++ nt/addsection.c 1970-01-01 00:00:00 +0000 @@ -1,544 +0,0 @@ -/* Add an uninitialized data section to an executable. - Copyright (C) 1999, 2001-2014 Free Software Foundation, Inc. - -This file is part of GNU Emacs. - -GNU Emacs is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -GNU Emacs is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Emacs. If not, see . - - - Andrew Innes 04-Jan-1999 - based on code from unexw32.c -*/ - -#include -#include -#include -#include -#if defined(__GNUC__) && !defined(_W64) -#define _ANONYMOUS_UNION -#define _ANONYMOUS_STRUCT -#endif -#include - -/* Include relevant definitions from IMAGEHLP.H, which can be found - in \\win32sdk\mstools\samples\image\include\imagehlp.h. */ - -PIMAGE_NT_HEADERS -(__stdcall * pfnCheckSumMappedFile) (PVOID BaseAddress, - DWORD_PTR FileLength, - PDWORD_PTR HeaderSum, - PDWORD_PTR CheckSum); - -#undef min -#undef max -#define min(x, y) (((x) < (y)) ? (x) : (y)) -#define max(x, y) (((x) > (y)) ? (x) : (y)) - - -/* File handling. */ - -typedef struct file_data { - const char *name; - unsigned long size; - HANDLE file; - HANDLE file_mapping; - unsigned char *file_base; -} file_data; - -int -open_input_file (file_data *p_file, const char *filename) -{ - HANDLE file; - HANDLE file_mapping; - void *file_base; - unsigned long size, upper_size; - - file = CreateFile (filename, GENERIC_READ, FILE_SHARE_READ, NULL, - OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); - if (file == INVALID_HANDLE_VALUE) - return FALSE; - - size = GetFileSize (file, &upper_size); - file_mapping = CreateFileMapping (file, NULL, PAGE_READONLY, - 0, size, NULL); - if (!file_mapping) - return FALSE; - - file_base = MapViewOfFile (file_mapping, FILE_MAP_READ, 0, 0, size); - if (file_base == 0) - return FALSE; - - p_file->name = filename; - p_file->size = size; - p_file->file = file; - p_file->file_mapping = file_mapping; - p_file->file_base = file_base; - - return TRUE; -} - -int -open_output_file (file_data *p_file, const char *filename, unsigned long size) -{ - HANDLE file; - HANDLE file_mapping; - void *file_base; - - file = CreateFile (filename, GENERIC_READ | GENERIC_WRITE, 0, NULL, - CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); - if (file == INVALID_HANDLE_VALUE) - return FALSE; - - file_mapping = CreateFileMapping (file, NULL, PAGE_READWRITE, - 0, size, NULL); - if (!file_mapping) - return FALSE; - - file_base = MapViewOfFile (file_mapping, FILE_MAP_WRITE, 0, 0, size); - if (file_base == 0) - return FALSE; - - p_file->name = filename; - p_file->size = size; - p_file->file = file; - p_file->file_mapping = file_mapping; - p_file->file_base = file_base; - - return TRUE; -} - -/* Close the system structures associated with the given file. */ -void -close_file_data (file_data *p_file) -{ - UnmapViewOfFile (p_file->file_base); - CloseHandle (p_file->file_mapping); - /* For the case of output files, set final size. */ - SetFilePointer (p_file->file, p_file->size, NULL, FILE_BEGIN); - SetEndOfFile (p_file->file); - CloseHandle (p_file->file); -} - - -/* Routines to manipulate NT executable file sections. */ - -unsigned long -get_unrounded_section_size (PIMAGE_SECTION_HEADER p_section) -{ - /* The true section size, before rounding, for an initialized data or - code section. (Supposedly some linkers swap the meaning of these - two values.) */ - return min (p_section->SizeOfRawData, - p_section->Misc.VirtualSize); -} - -/* Return pointer to section header for named section. */ -IMAGE_SECTION_HEADER * -find_section (const char *name, IMAGE_NT_HEADERS *nt_header) -{ - PIMAGE_SECTION_HEADER section; - int i; - - section = IMAGE_FIRST_SECTION (nt_header); - - for (i = 0; i < nt_header->FileHeader.NumberOfSections; i++) - { - if (strcmp (section->Name, name) == 0) - return section; - section++; - } - return NULL; -} - -/* Return pointer to section header for section containing the given - relative virtual address. */ -IMAGE_SECTION_HEADER * -rva_to_section (DWORD_PTR rva, IMAGE_NT_HEADERS * nt_header) -{ - PIMAGE_SECTION_HEADER section; - int i; - - section = IMAGE_FIRST_SECTION (nt_header); - - for (i = 0; i < nt_header->FileHeader.NumberOfSections; i++) - { - /* Some linkers (eg. the NT SDK linker I believe) swapped the - meaning of these two values - or rather, they ignored - VirtualSize entirely and always set it to zero. This affects - some very old exes (eg. gzip dated Dec 1993). Since - w32_executable_type relies on this function to work reliably, - we need to cope with this. */ - DWORD_PTR real_size = max (section->SizeOfRawData, - section->Misc.VirtualSize); - if (rva >= section->VirtualAddress - && rva < section->VirtualAddress + real_size) - return section; - section++; - } - return NULL; -} - -/* Return pointer to section header for section containing the given - offset in its raw data area. */ -IMAGE_SECTION_HEADER * -offset_to_section (DWORD_PTR offset, IMAGE_NT_HEADERS * nt_header) -{ - PIMAGE_SECTION_HEADER section; - int i; - - section = IMAGE_FIRST_SECTION (nt_header); - - for (i = 0; i < nt_header->FileHeader.NumberOfSections; i++) - { - if (offset >= section->PointerToRawData - && offset < section->PointerToRawData + section->SizeOfRawData) - return section; - section++; - } - return NULL; -} - -/* Return offset to an object in dst, given offset in src. We assume - there is at least one section in both src and dst images, and that - the some sections may have been added to dst (after sections in src). */ -static DWORD_PTR -relocate_offset (DWORD_PTR offset, - IMAGE_NT_HEADERS * src_nt_header, - IMAGE_NT_HEADERS * dst_nt_header) -{ - PIMAGE_SECTION_HEADER src_section = IMAGE_FIRST_SECTION (src_nt_header); - PIMAGE_SECTION_HEADER dst_section = IMAGE_FIRST_SECTION (dst_nt_header); - int i = 0; - - while (offset >= src_section->PointerToRawData) - { - if (offset < src_section->PointerToRawData + src_section->SizeOfRawData) - break; - i++; - if (i == src_nt_header->FileHeader.NumberOfSections) - { - /* Handle offsets after the last section. */ - dst_section = IMAGE_FIRST_SECTION (dst_nt_header); - dst_section += dst_nt_header->FileHeader.NumberOfSections - 1; - while (dst_section->PointerToRawData == 0) - dst_section--; - while (src_section->PointerToRawData == 0) - src_section--; - return offset - + (dst_section->PointerToRawData + dst_section->SizeOfRawData) - - (src_section->PointerToRawData + src_section->SizeOfRawData); - } - src_section++; - dst_section++; - } - return offset + - (dst_section->PointerToRawData - src_section->PointerToRawData); -} - -#define OFFSET_TO_RVA(offset, section) \ - (section->VirtualAddress + ((DWORD_PTR)(offset) - section->PointerToRawData)) - -#define RVA_TO_OFFSET(rva, section) \ - (section->PointerToRawData + ((DWORD_PTR)(rva) - section->VirtualAddress)) - -#define RVA_TO_SECTION_OFFSET(rva, section) \ - ((DWORD_PTR)(rva) - section->VirtualAddress) - -/* Convert address in executing image to RVA. */ -#define PTR_TO_RVA(ptr) ((DWORD_PTR)(ptr) - (DWORD_PTR) GetModuleHandle (NULL)) - -#define PTR_TO_OFFSET(ptr, pfile_data) \ - ((unsigned const char *)(ptr) - (pfile_data)->file_base) - -#define OFFSET_TO_PTR(offset, pfile_data) \ - ((pfile_data)->file_base + (DWORD_PTR)(offset)) - -#define ROUND_UP(p, align) \ - (((DWORD_PTR)(p) + (align)-1) & ~((DWORD_PTR)(align)-1)) -#define ROUND_DOWN(p, align) ((DWORD_PTR)(p) & ~((DWORD_PTR)(align)-1)) - - -static void -copy_executable_and_add_section (file_data *p_infile, - file_data *p_outfile, - const char *new_section_name, - DWORD_PTR new_section_size) -{ - unsigned char *dst; - PIMAGE_DOS_HEADER dos_header; - PIMAGE_NT_HEADERS nt_header; - PIMAGE_NT_HEADERS dst_nt_header; - PIMAGE_SECTION_HEADER section; - PIMAGE_SECTION_HEADER dst_section; - DWORD_PTR offset; - int i; - int be_verbose = GetEnvironmentVariable ("DEBUG_DUMP", NULL, 0) > 0; - -#define COPY_CHUNK(message, src, size, verbose) \ - do { \ - unsigned const char *s = (void *)(src); \ - unsigned long count = (size); \ - if (verbose) \ - { \ - printf ("%s\n", (message)); \ - printf ("\t0x%08x Offset in input file.\n", s - p_infile->file_base); \ - printf ("\t0x%08x Offset in output file.\n", dst - p_outfile->file_base); \ - printf ("\t0x%08x Size in bytes.\n", count); \ - } \ - memcpy (dst, s, count); \ - dst += count; \ - } while (0) - -#define DST_TO_OFFSET() PTR_TO_OFFSET (dst, p_outfile) -#define ROUND_UP_DST_AND_ZERO(align) \ - do { \ - unsigned char *newdst = p_outfile->file_base \ - + ROUND_UP (DST_TO_OFFSET (), (align)); \ - /* Zero the alignment slop; it may actually initialize real data. */ \ - memset (dst, 0, newdst - dst); \ - dst = newdst; \ - } while (0) - - /* Copy the source image sequentially, ie. section by section after - copying the headers and section table, to simplify the process of - adding an extra section table entry (which might force the raw - section data to be relocated). - - Note that dst is updated implicitly by each COPY_CHUNK. */ - - dos_header = (PIMAGE_DOS_HEADER) p_infile->file_base; - nt_header = (PIMAGE_NT_HEADERS) (((unsigned char *) dos_header) + - dos_header->e_lfanew); - section = IMAGE_FIRST_SECTION (nt_header); - - dst = (unsigned char *) p_outfile->file_base; - - COPY_CHUNK ("Copying DOS header...", dos_header, - (DWORD_PTR) nt_header - (DWORD_PTR) dos_header, be_verbose); - dst_nt_header = (PIMAGE_NT_HEADERS) dst; - COPY_CHUNK ("Copying NT header...", nt_header, - (DWORD_PTR) section - (DWORD_PTR) nt_header, be_verbose); - dst_section = (PIMAGE_SECTION_HEADER) dst; - COPY_CHUNK ("Copying section table...", section, - nt_header->FileHeader.NumberOfSections * sizeof (*section), - be_verbose); - - /* To improve the efficiency of demand loading, make the file - alignment match the section alignment (VC++ 6.0 does this by - default anyway). */ - dst_nt_header->OptionalHeader.FileAlignment = - dst_nt_header->OptionalHeader.SectionAlignment; - - /* Add an uninitialized data section at the end, of the specified name - and virtual size. */ - if (find_section (new_section_name, nt_header) == NULL) - /* Leave room for extra section table entry; filled in below. */ - dst += sizeof (*section); - else - new_section_name = NULL; - - /* Align the first section's raw data area, and set the header size - field accordingly. */ - ROUND_UP_DST_AND_ZERO (dst_nt_header->OptionalHeader.FileAlignment); - dst_nt_header->OptionalHeader.SizeOfHeaders = DST_TO_OFFSET (); - - for (i = 0; i < nt_header->FileHeader.NumberOfSections; i++) - { - char msg[100]; - /* Windows section names are fixed 8-char strings, only - zero-terminated if the name is shorter than 8 characters. */ - sprintf (msg, "Copying raw data for %.8s...", section->Name); - - /* Update the file-relative offset for this section's raw data (if - it has any) in case things have been relocated; we will update - the other offsets below once we know where everything is. */ - if (dst_section->PointerToRawData) - dst_section->PointerToRawData = DST_TO_OFFSET (); - - /* Can always copy the original raw data. */ - COPY_CHUNK - (msg, OFFSET_TO_PTR (section->PointerToRawData, p_infile), - section->SizeOfRawData, be_verbose); - - /* Round up the raw data size to the new alignment. */ - dst_section->SizeOfRawData = - ROUND_UP (dst_section->SizeOfRawData, - dst_nt_header->OptionalHeader.FileAlignment); - - /* Align the next section's raw data area. */ - ROUND_UP_DST_AND_ZERO (dst_nt_header->OptionalHeader.FileAlignment); - - section++; - dst_section++; - } - - /* Add the extra section entry (which adds no raw data). */ - if (new_section_name != NULL) - { - dst_nt_header->FileHeader.NumberOfSections++; - dst_nt_header->OptionalHeader.SizeOfImage += new_section_size; - strncpy (dst_section->Name, new_section_name, sizeof (dst_section->Name)); - dst_section->VirtualAddress = - section[-1].VirtualAddress - + ROUND_UP (section[-1].Misc.VirtualSize, - dst_nt_header->OptionalHeader.SectionAlignment); - dst_section->Misc.VirtualSize = new_section_size; - dst_section->PointerToRawData = 0; - dst_section->SizeOfRawData = 0; - dst_section->Characteristics = - IMAGE_SCN_CNT_UNINITIALIZED_DATA - | IMAGE_SCN_MEM_READ - | IMAGE_SCN_MEM_WRITE; - } - - /* Copy remainder of source image. */ - section--; - offset = ROUND_UP (section->PointerToRawData + section->SizeOfRawData, - nt_header->OptionalHeader.FileAlignment); - COPY_CHUNK - ("Copying remainder of executable...", - OFFSET_TO_PTR (offset, p_infile), - p_infile->size - offset, be_verbose); - - /* Final size for new image. */ - p_outfile->size = DST_TO_OFFSET (); - - /* Now patch up remaining file-relative offsets. */ - section = IMAGE_FIRST_SECTION (nt_header); - dst_section = IMAGE_FIRST_SECTION (dst_nt_header); - -#define ADJUST_OFFSET(var) \ - do { \ - if ((var) != 0) \ - (var) = relocate_offset ((var), nt_header, dst_nt_header); \ - } while (0) - - dst_nt_header->OptionalHeader.SizeOfInitializedData = 0; - dst_nt_header->OptionalHeader.SizeOfUninitializedData = 0; - for (i = 0; i < dst_nt_header->FileHeader.NumberOfSections; i++) - { - /* Recompute data sizes for completeness. */ - if (dst_section[i].Characteristics & IMAGE_SCN_CNT_INITIALIZED_DATA) - dst_nt_header->OptionalHeader.SizeOfInitializedData += - ROUND_UP (dst_section[i].Misc.VirtualSize, dst_nt_header->OptionalHeader.FileAlignment); - else if (dst_section[i].Characteristics & IMAGE_SCN_CNT_UNINITIALIZED_DATA) - dst_nt_header->OptionalHeader.SizeOfUninitializedData += - ROUND_UP (dst_section[i].Misc.VirtualSize, dst_nt_header->OptionalHeader.FileAlignment); - - ADJUST_OFFSET (dst_section[i].PointerToLinenumbers); - } - - ADJUST_OFFSET (dst_nt_header->FileHeader.PointerToSymbolTable); - - /* Update offsets in debug directory entries. */ - { - IMAGE_DATA_DIRECTORY debug_dir = - dst_nt_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_DEBUG]; - PIMAGE_DEBUG_DIRECTORY debug_entry; - - section = rva_to_section (debug_dir.VirtualAddress, dst_nt_header); - if (section) - { - debug_entry = (PIMAGE_DEBUG_DIRECTORY) - (RVA_TO_OFFSET (debug_dir.VirtualAddress, section) + p_outfile->file_base); - debug_dir.Size /= sizeof (IMAGE_DEBUG_DIRECTORY); - - for (i = 0; i < debug_dir.Size; i++, debug_entry++) - ADJUST_OFFSET (debug_entry->PointerToRawData); - } - } -} - - -int -main (int argc, char **argv) -{ - file_data in_file, out_file; - char out_filename[MAX_PATH], in_filename[MAX_PATH]; - unsigned long size; - PIMAGE_DOS_HEADER dos_header; - PIMAGE_NT_HEADERS nt_header; - -#define OLD_NAME argv[1] -#define NEW_NAME argv[2] -#define SECTION_NAME argv[3] -#define SECTION_SIZE argv[4] - - strcpy (in_filename, OLD_NAME); - strcpy (out_filename, NEW_NAME); - - printf ("Dumping from %s\n", in_filename); - printf (" to %s\n", out_filename); - - /* Open the undumped executable file. */ - if (!open_input_file (&in_file, in_filename)) - { - printf ("Failed to open %s (%d)...bailing.\n", - in_filename, GetLastError ()); - exit (1); - } - dos_header = (PIMAGE_DOS_HEADER) in_file.file_base; - nt_header = (PIMAGE_NT_HEADERS) ((char *) dos_header + dos_header->e_lfanew); - /* Allow for expansion due to increasing file align to section align. - We can overestimate here, since close_file_data will update the - size exactly. */ - size = in_file.size - + nt_header->OptionalHeader.SectionAlignment - * nt_header->FileHeader.NumberOfSections; - if (!open_output_file (&out_file, out_filename, size)) - { - printf ("Failed to open %s (%d)...bailing.\n", - out_filename, GetLastError ()); - exit (1); - } - - copy_executable_and_add_section (&in_file, &out_file, - SECTION_NAME, - atoi (SECTION_SIZE) * 1024 * 1024); - - /* Patch up header fields; profiler is picky about this. */ - { - HANDLE hImagehelp = LoadLibrary ("imagehlp.dll"); - DWORD_PTR headersum; - DWORD_PTR checksum; - - dos_header = (PIMAGE_DOS_HEADER) out_file.file_base; - nt_header = (PIMAGE_NT_HEADERS) ((char *) dos_header + dos_header->e_lfanew); - - nt_header->OptionalHeader.CheckSum = 0; -// nt_header->FileHeader.TimeDateStamp = time (NULL); -// dos_header->e_cp = size / 512; -// nt_header->OptionalHeader.SizeOfImage = size; - - pfnCheckSumMappedFile = (void *) GetProcAddress (hImagehelp, "CheckSumMappedFile"); - if (pfnCheckSumMappedFile) - { -// nt_header->FileHeader.TimeDateStamp = time (NULL); - pfnCheckSumMappedFile (out_file.file_base, - out_file.size, - &headersum, - &checksum); - nt_header->OptionalHeader.CheckSum = checksum; - } - FreeLibrary (hImagehelp); - } - - close_file_data (&in_file); - close_file_data (&out_file); - - return 0; -} - -/* eof */ - === modified file 'src/ChangeLog' --- src/ChangeLog 2014-05-29 17:16:00 +0000 +++ src/ChangeLog 2014-05-29 19:16:32 +0000 @@ -1,3 +1,9 @@ +2014-05-29 Eli Zaretskii + + * Makefile.in (TEMACS_POST_LINK): Remove target. + (emacs$(EXEEXT)): Remove $(ADDSECTION) from prerequisites. + (temacs$(EXEEXT)): Remove $(TEMACS_POST_LINK) from the recipe. + 2014-05-29 Dmitry Antipov * xmenu.c (xdialog_show): Remove prototype, rename to === modified file 'src/Makefile.in' --- src/Makefile.in 2014-05-29 15:05:06 +0000 +++ src/Makefile.in 2014-05-29 19:16:32 +0000 @@ -299,8 +299,7 @@ RUN_TEMACS = ./temacs -## Invoke ../nt/addsection for MinGW, ":" elsewhere. -TEMACS_POST_LINK = @TEMACS_POST_LINK@ +## Static heap size for temacs on MinGW. EMACS_HEAPSIZE = @EMACS_HEAPSIZE@ UNEXEC_OBJ = @UNEXEC_OBJ@ @@ -428,7 +427,7 @@ ## Strictly speaking, emacs does not depend directly on all of $lisp, ## since not all pieces are used on all platforms. But DOC depends ## on all of $lisp, and emacs depends on DOC, so it is ok to use $lisp here. -emacs$(EXEEXT): temacs$(EXEEXT) $(ADDSECTION) \ +emacs$(EXEEXT): temacs$(EXEEXT) \ $(etc)/DOC $(lisp) $(leimdir)/leim-list.el \ $(lispsource)/international/charprop.el if test "$(CANNOT_DUMP)" = "yes"; then \ @@ -494,7 +493,6 @@ $(CC) $(ALL_CFLAGS) $(TEMACS_LDFLAGS) $(LDFLAGS) \ -o temacs $(ALLOBJS) $(lib)/libgnu.a $(W32_RES_LINK) $(LIBES) $(MKDIR_P) $(etc) - $(TEMACS_POST_LINK) test "$(CANNOT_DUMP)" = "yes" || \ test "X$(PAXCTL)" = X || $(PAXCTL) -r temacs$(EXEEXT) test "$(CANNOT_DUMP)" = "yes" || test -z "$(SETFATTR)" || \ ------------------------------------------------------------ revno: 117192 committer: Dmitry Antipov branch nick: trunk timestamp: Thu 2014-05-29 21:16:00 +0400 message: * xmenu.c (xdialog_show): Remove prototype, rename to x_dialog_show, remove 2nd arg because it's always zero and simplify accordingly. (xw_popup_dialog): Adjust user. * w32menu.c (w32_dialog_show): Adjust prototype, remove 2nd arg because it's always zero and simplify accordingly. (w32_popup_dialog): Adjust user. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-05-29 17:15:02 +0000 +++ src/ChangeLog 2014-05-29 17:16:00 +0000 @@ -1,3 +1,13 @@ +2014-05-29 Dmitry Antipov + + * xmenu.c (xdialog_show): Remove prototype, rename to + x_dialog_show, remove 2nd arg because it's always zero + and simplify accordingly. + (xw_popup_dialog): Adjust user. + * w32menu.c (w32_dialog_show): Adjust prototype, remove + 2nd arg because it's always zero and simplify accordingly. + (w32_popup_dialog): Adjust user. + 2014-05-29 Eli Zaretskii * w32heap.c (report_temacs_memory_usage): New function. === modified file 'src/w32menu.c' --- src/w32menu.c 2014-02-04 16:13:51 +0000 +++ src/w32menu.c 2014-05-29 17:16:00 +0000 @@ -103,7 +103,7 @@ void set_frame_menubar (struct frame *, bool, bool); #ifdef HAVE_DIALOGS -static Lisp_Object w32_dialog_show (struct frame *, int, Lisp_Object, char**); +static Lisp_Object w32_dialog_show (struct frame *, Lisp_Object, Lisp_Object, char **); #else static int is_simple_dialog (Lisp_Object); static Lisp_Object simple_dialog_show (struct frame *, Lisp_Object, Lisp_Object); @@ -141,7 +141,7 @@ /* Display them in a dialog box. */ block_input (); - selection = w32_dialog_show (f, 0, title, header, &error_name); + selection = w32_dialog_show (f, title, header, &error_name); unblock_input (); discard_menu_items (); @@ -904,9 +904,8 @@ "button6", "button7", "button8", "button9", "button10" }; static Lisp_Object -w32_dialog_show (struct frame *f, int keymaps, - Lisp_Object title, Lisp_Object header, - char **error) +w32_dialog_show (struct frame *f, Lisp_Object title, + Lisp_Object header, char **error) { int i, nb_buttons = 0; char dialog_name[6]; @@ -930,16 +929,13 @@ /* Create a tree of widget_value objects representing the text label and buttons. */ { - Lisp_Object pane_name, prefix; + Lisp_Object pane_name; char *pane_string; pane_name = AREF (menu_items, MENU_ITEMS_PANE_NAME); - prefix = AREF (menu_items, MENU_ITEMS_PANE_PREFIX); pane_string = (NILP (pane_name) ? "" : SSDATA (pane_name)); prev_wv = xmalloc_widget_value (); prev_wv->value = pane_string; - if (keymaps && !NILP (prefix)) - prev_wv->name++; prev_wv->enabled = 1; prev_wv->name = "message"; prev_wv->help = Qnil; @@ -1052,32 +1048,18 @@ the proper value. */ if (menu_item_selection != 0) { - Lisp_Object prefix; - - prefix = Qnil; i = 0; while (i < menu_items_used) { Lisp_Object entry; if (EQ (AREF (menu_items, i), Qt)) - { - prefix = AREF (menu_items, i + MENU_ITEMS_PANE_PREFIX); - i += MENU_ITEMS_PANE_LENGTH; - } + i += MENU_ITEMS_PANE_LENGTH; else { - entry = AREF (menu_items, i + MENU_ITEMS_ITEM_VALUE); + entry = AREF (menu_items, i + MENU_ITEMS_ITEM_VALUE); if (menu_item_selection == i) - { - if (keymaps != 0) - { - entry = Fcons (entry, Qnil); - if (!NILP (prefix)) - entry = Fcons (prefix, entry); - } - return entry; - } + return entry; i += MENU_ITEMS_ITEM_LENGTH; } } === modified file 'src/xmenu.c' --- src/xmenu.c 2014-01-29 18:39:11 +0000 +++ src/xmenu.c 2014-05-29 17:16:00 +0000 @@ -110,11 +110,6 @@ static Lisp_Object Qdebug_on_next_call; -#if defined (USE_X_TOOLKIT) || defined (USE_GTK) -static Lisp_Object xdialog_show (struct frame *, bool, Lisp_Object, Lisp_Object, - const char **); -#endif - /* Flag which when set indicates a dialog or menu has been posted by Xt on behalf of one of the widget sets. */ static int popup_activated_flag; @@ -1839,11 +1834,8 @@ "button6", "button7", "button8", "button9", "button10" }; static Lisp_Object -xdialog_show (struct frame *f, - bool keymaps, - Lisp_Object title, - Lisp_Object header, - const char **error_name) +x_dialog_show (struct frame *f, Lisp_Object title, + Lisp_Object header, const char **error_name) { int i, nb_buttons=0; char dialog_name[6]; @@ -1870,16 +1862,13 @@ /* Create a tree of widget_value objects representing the text label and buttons. */ { - Lisp_Object pane_name, prefix; + Lisp_Object pane_name; const char *pane_string; pane_name = AREF (menu_items, MENU_ITEMS_PANE_NAME); - prefix = AREF (menu_items, MENU_ITEMS_PANE_PREFIX); pane_string = (NILP (pane_name) ? "" : SSDATA (pane_name)); prev_wv = xmalloc_widget_value (); prev_wv->value = (char *) pane_string; - if (keymaps && !NILP (prefix)) - prev_wv->name++; prev_wv->enabled = 1; prev_wv->name = "message"; prev_wv->help = Qnil; @@ -1982,20 +1971,13 @@ the proper value. */ if (menu_item_selection != 0) { - Lisp_Object prefix; - - prefix = Qnil; i = 0; while (i < menu_items_used) { Lisp_Object entry; if (EQ (AREF (menu_items, i), Qt)) - { - prefix - = AREF (menu_items, i + MENU_ITEMS_PANE_PREFIX); - i += MENU_ITEMS_PANE_LENGTH; - } + i += MENU_ITEMS_PANE_LENGTH; else if (EQ (AREF (menu_items, i), Qquote)) { /* This is the boundary between left-side elts and @@ -2007,15 +1989,7 @@ entry = AREF (menu_items, i + MENU_ITEMS_ITEM_VALUE); if (menu_item_selection == aref_addr (menu_items, i)) - { - if (keymaps != 0) - { - entry = list1 (entry); - if (!NILP (prefix)) - entry = Fcons (prefix, entry); - } - return entry; - } + return entry; i += MENU_ITEMS_ITEM_LENGTH; } } @@ -2052,7 +2026,7 @@ /* Display them in a dialog box. */ block_input (); - selection = xdialog_show (f, 0, title, header, &error_name); + selection = x_dialog_show (f, title, header, &error_name); unblock_input (); unbind_to (specpdl_count, Qnil); ------------------------------------------------------------ revno: 117191 committer: Eli Zaretskii branch nick: trunk timestamp: Thu 2014-05-29 20:15:02 +0300 message: src/ChangeLog: Fix a recent log entry. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-05-29 15:21:08 +0000 +++ src/ChangeLog 2014-05-29 17:15:02 +0000 @@ -83,6 +83,7 @@ 2014-05-27 Fabrice Popineau + Use mmap(2) emulation for allocating buffer text on MS-Windows. * Makefile.in (C_HEAP_SWITCH): Get the predefined heap size from configure. (ADDSECTION, MINGW_TEMACS_POST_LINK): Remove, no longer used. ------------------------------------------------------------ revno: 117190 committer: Stefan Monnier branch nick: trunk timestamp: Thu 2014-05-29 11:36:09 -0400 message: * lisp/subr.el (sit-for): Remove universal-arg dependency. diff: === modified file 'lisp/subr.el' --- lisp/subr.el 2014-05-28 06:51:36 +0000 +++ lisp/subr.el 2014-05-29 15:36:09 +0000 @@ -2181,12 +2181,16 @@ (let ((read (read-event nil t seconds))) (or (null read) (progn - ;; If last command was a prefix arg, e.g. C-u, push this event onto - ;; unread-command-events as (t . EVENT) so it will be added to - ;; this-command-keys by read-key-sequence. - (if (eq overriding-terminal-local-map universal-argument-map) - (setq read (cons t read))) - (push read unread-command-events) + ;; https://lists.gnu.org/archive/html/emacs-devel/2006-10/msg00394.html + ;; We want `read' appear in the next command's this-command-event + ;; but not in the current one. + ;; By pushing (cons t read), we indicate that `read' has not + ;; yet been recorded in this-command-keys, so it will be recorded + ;; next time it's read. + ;; And indeed the `seconds' argument to read-event correctly + ;; prevented recording this event in the current command's + ;; this-command-keys. + (push (cons t read) unread-command-events) nil)))))) ;; Behind display-popup-menus-p test. ------------------------------------------------------------ revno: 117189 committer: Eli Zaretskii branch nick: trunk timestamp: Thu 2014-05-29 18:21:08 +0300 message: Add diagnostics for using private heap on MS-Windows during dumping. src/w32heap.c (report_temacs_memory_usage): New function. src/unexw32.c (unexec) [ENABLE_CHECKING]: Call report_temacs_memory_usage. src/w32heap.h (report_temacs_memory_usage): Add prototype. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-05-29 15:05:06 +0000 +++ src/ChangeLog 2014-05-29 15:21:08 +0000 @@ -1,3 +1,12 @@ +2014-05-29 Eli Zaretskii + + * w32heap.c (report_temacs_memory_usage): New function. + + * unexw32.c (unexec) [ENABLE_CHECKING]: Call + report_temacs_memory_usage. + + * w32heap.h (report_temacs_memory_usage): Add prototype. + 2014-05-29 Paul Eggert Don't substitute sigprocmask for pthread_sigmask (Bug#17561). === modified file 'src/unexw32.c' --- src/unexw32.c 2014-05-27 17:31:17 +0000 +++ src/unexw32.c 2014-05-29 15:21:08 +0000 @@ -728,6 +728,10 @@ abort (); strcpy (p, q); +#ifdef ENABLE_CHECKING + report_temacs_memory_usage (); +#endif + /* Make sure that the output filename has the ".exe" extension...patch it up if not. */ p = out_filename + strlen (out_filename) - 4; === modified file 'src/w32heap.c' --- src/w32heap.c 2014-05-27 17:31:17 +0000 +++ src/w32heap.c 2014-05-29 15:21:08 +0000 @@ -448,6 +448,19 @@ } } +#ifdef ENABLE_CHECKING +void +report_temacs_memory_usage (void) +{ + /* Emulate 'message', which writes to stderr in non-interactive + sessions. */ + fprintf (stderr, + "Dump memory usage: Heap: %" PRIu64 " Large blocks(%lu): %" PRIu64 "\n", + (unsigned long long)committed, blocks_number, + (unsigned long long)(dumped_data + DUMPED_HEAP_SIZE - bc_limit)); +} +#endif + /* Emulate getpagesize. */ int getpagesize (void) === modified file 'src/w32heap.h' --- src/w32heap.h 2014-05-27 17:31:17 +0000 +++ src/w32heap.h 2014-05-29 15:21:08 +0000 @@ -41,6 +41,7 @@ extern void mmap_free (void **); extern void *mmap_alloc (void **, size_t); +extern void report_temacs_memory_usage (void); /* Emulation of Unix sbrk(). */ extern void *sbrk (ptrdiff_t size); ------------------------------------------------------------ revno: 117188 fixes bug: http://debbugs.gnu.org/17561 committer: Paul Eggert branch nick: trunk timestamp: Thu 2014-05-29 08:05:06 -0700 message: Don't substitute sigprocmask for pthread_sigmask. sigprocmask isn't portable in a multithreaded process. * configure.ac (gl_THREADLIB): Remove dummy. Merge from gnulib, incorporating: 2014-05-28 pthread_sigmask, timer-time: use gl_THREADLIB only if needed * m4/pthread_sigmask.m4, m4/timer_time.m4: Update from gnulib. * src/Makefile.in (LIB_PTHREAD_SIGMASK): Remove; all uses removed. diff: === modified file 'ChangeLog' --- ChangeLog 2014-05-29 01:36:44 +0000 +++ ChangeLog 2014-05-29 15:05:06 +0000 @@ -1,3 +1,12 @@ +2014-05-29 Paul Eggert + + Don't substitute sigprocmask for pthread_sigmask (Bug#17561). + sigprocmask isn't portable in a multithreaded process. + * configure.ac (gl_THREADLIB): Remove dummy. + Merge from gnulib, incorporating: + 2014-05-28 pthread_sigmask, timer-time: use gl_THREADLIB only if needed + * m4/pthread_sigmask.m4, m4/timer_time.m4: Update from gnulib. + 2014-05-29 Glenn Morris * configure.ac: Explicitly drop some ancient Solaris versions. === modified file 'configure.ac' --- configure.ac 2014-05-29 01:36:44 +0000 +++ configure.ac 2014-05-29 15:05:06 +0000 @@ -704,8 +704,6 @@ # Avoid gnulib's tests for HAVE_WORKING_O_NOATIME and HAVE_WORKING_O_NOFOLLOW, # as we don't use them. AC_DEFUN([gl_FCNTL_O_FLAGS]) -# Avoid gnulib's threadlib module, as we do threads our own way. -AC_DEFUN([gl_THREADLIB]) # Initialize gnulib right after choosing the compiler. dnl Amongst other things, this sets AR and ARFLAGS. === modified file 'm4/pthread_sigmask.m4' --- m4/pthread_sigmask.m4 2014-01-01 07:43:34 +0000 +++ m4/pthread_sigmask.m4 2014-05-29 15:05:06 +0000 @@ -1,4 +1,4 @@ -# pthread_sigmask.m4 serial 13 +# pthread_sigmask.m4 serial 14 dnl Copyright (C) 2011-2014 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -97,39 +97,43 @@ dnl with -lpthread, the pthread_sigmask() function always returns 0 and has dnl no effect. if test -z "$LIB_PTHREAD_SIGMASK"; then - AC_CACHE_CHECK([whether pthread_sigmask works without -lpthread], - [gl_cv_func_pthread_sigmask_in_libc_works], - [ - AC_RUN_IFELSE( - [AC_LANG_SOURCE([[ -#include -#include -#include -int main () -{ - sigset_t set; - sigemptyset (&set); - return pthread_sigmask (1729, &set, NULL) != 0; -}]])], - [gl_cv_func_pthread_sigmask_in_libc_works=no], - [gl_cv_func_pthread_sigmask_in_libc_works=yes], - [ -changequote(,)dnl - case "$host_os" in - freebsd* | hpux* | solaris | solaris2.[2-9]*) - gl_cv_func_pthread_sigmask_in_libc_works="guessing no";; - *) - gl_cv_func_pthread_sigmask_in_libc_works="guessing yes";; - esac -changequote([,])dnl - ]) - ]) - case "$gl_cv_func_pthread_sigmask_in_libc_works" in - *no) - REPLACE_PTHREAD_SIGMASK=1 - AC_DEFINE([PTHREAD_SIGMASK_INEFFECTIVE], [1], - [Define to 1 if pthread_sigmask() may returns 0 and have no effect.]) - ;; + case " $LIBS " in + *' -lpthread '*) ;; + *) + AC_CACHE_CHECK([whether pthread_sigmask works without -lpthread], + [gl_cv_func_pthread_sigmask_in_libc_works], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ + #include + #include + #include + int main () + { + sigset_t set; + sigemptyset (&set); + return pthread_sigmask (1729, &set, NULL) != 0; + }]])], + [gl_cv_func_pthread_sigmask_in_libc_works=no], + [gl_cv_func_pthread_sigmask_in_libc_works=yes], + [ + changequote(,)dnl + case "$host_os" in + freebsd* | hpux* | solaris | solaris2.[2-9]*) + gl_cv_func_pthread_sigmask_in_libc_works="guessing no";; + *) + gl_cv_func_pthread_sigmask_in_libc_works="guessing yes";; + esac + changequote([,])dnl + ]) + ]) + case "$gl_cv_func_pthread_sigmask_in_libc_works" in + *no) + REPLACE_PTHREAD_SIGMASK=1 + AC_DEFINE([PTHREAD_SIGMASK_INEFFECTIVE], [1], + [Define to 1 if pthread_sigmask may return 0 and have no effect.]) + ;; + esac;; esac fi @@ -184,11 +188,12 @@ *) gl_cv_func_pthread_sigmask_unblock_works="guessing yes";; esac - dnl Here we link against $LIBMULTITHREAD, not only $LIB_PTHREAD_SIGMASK, - dnl otherwise we get a false positive on those platforms where - dnl $gl_cv_func_pthread_sigmask_in_libc_works is "no". - gl_save_LIBS="$LIBS" - LIBS="$LIBS $LIBMULTITHREAD" + m4_ifdef([gl_][THREADLIB], + [dnl Link against $LIBMULTITHREAD, not only $LIB_PTHREAD_SIGMASK. + dnl Otherwise we get a false positive on those platforms where + dnl $gl_cv_func_pthread_sigmask_in_libc_works is "no". + gl_save_LIBS=$LIBS + LIBS="$LIBS $LIBMULTITHREAD"]) AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include @@ -227,7 +232,7 @@ [:], [gl_cv_func_pthread_sigmask_unblock_works=no], [:]) - LIBS="$gl_save_LIBS" + m4_ifdef([gl_][THREADLIB], [LIBS=$gl_save_LIBS]) ]) case "$gl_cv_func_pthread_sigmask_unblock_works" in *no) === modified file 'm4/timer_time.m4' --- m4/timer_time.m4 2014-02-24 07:12:42 +0000 +++ m4/timer_time.m4 2014-05-29 15:05:06 +0000 @@ -1,4 +1,4 @@ -# timer_time.m4 serial 2 +# timer_time.m4 serial 3 dnl Copyright (C) 2011-2014 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -11,7 +11,12 @@ dnl Based on clock_time.m4. See details there. AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) - AC_REQUIRE([gl_THREADLIB]) + + dnl Test whether the gnulib module 'threadlib' is in use. + dnl Some packages like Emacs use --avoid=threadlib. + dnl Write the symbol in such a way that it does not cause 'aclocal' to pick + dnl the threadlib.m4 file that is installed in $PREFIX/share/aclocal/. + m4_ifdef([gl_][THREADLIB], [AC_REQUIRE([gl_][THREADLIB])]) LIB_TIMER_TIME= AC_SUBST([LIB_TIMER_TIME]) @@ -19,21 +24,21 @@ AC_SEARCH_LIBS([timer_settime], [rt posix4], [test "$ac_cv_search_timer_settime" = "none required" || LIB_TIMER_TIME=$ac_cv_search_timer_settime]) - dnl GLIBC uses threads to emulate posix timers when kernel support - dnl is not available (like Linux < 2.6 or when used with kFreeBSD) - dnl Now the pthread lib is linked automatically in the normal case, - dnl but when linking statically, it needs to be explicitly specified. - AC_EGREP_CPP([Thread], - [ -#include -#ifdef __GNU_LIBRARY__ - #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || (__GLIBC__ > 2)) \ - && !(__UCLIBC__ && __HAS_NO_THREADS__) - Thread emulation available - #endif -#endif - ], - [LIB_TIMER_TIME="$LIB_TIMER_TIME $LIBMULTITHREAD"]) + m4_ifdef([gl_][THREADLIB], + [dnl GLIBC uses threads to emulate posix timers when kernel support + dnl is not available (like Linux < 2.6 or when used with kFreeBSD) + dnl Now the pthread lib is linked automatically in the normal case, + dnl but when linking statically, it needs to be explicitly specified. + AC_EGREP_CPP([Thread], + [#include + #ifdef __GNU_LIBRARY__ + #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || (__GLIBC__ > 2)) \ + && !(__UCLIBC__ && __HAS_NO_THREADS__) + Thread emulation available + #endif + #endif + ], + [LIB_TIMER_TIME="$LIB_TIMER_TIME $LIBMULTITHREAD"])]) AC_CHECK_FUNCS([timer_settime]) LIBS=$gl_saved_libs ]) === modified file 'src/ChangeLog' --- src/ChangeLog 2014-05-29 14:52:47 +0000 +++ src/ChangeLog 2014-05-29 15:05:06 +0000 @@ -1,3 +1,8 @@ +2014-05-29 Paul Eggert + + Don't substitute sigprocmask for pthread_sigmask (Bug#17561). + * Makefile.in (LIB_PTHREAD_SIGMASK): Remove; all uses removed. + 2014-05-29 Eli Zaretskii * buffer.c (init_buffer): Accept an argument 'initialized'. === modified file 'src/Makefile.in' --- src/Makefile.in 2014-05-27 17:31:17 +0000 +++ src/Makefile.in 2014-05-29 15:05:06 +0000 @@ -125,7 +125,7 @@ ## -lm, or empty. LIB_MATH=@LIB_MATH@ -## -lpthreads, or empty. +## -lpthread, or empty. LIB_PTHREAD=@LIB_PTHREAD@ LIBIMAGE=@LIBTIFF@ @LIBJPEG@ @LIBPNG@ @LIBGIF@ @LIBXPM@ @@ -293,8 +293,6 @@ LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ -LIB_PTHREAD_SIGMASK = @LIB_PTHREAD_SIGMASK@ - INTERVALS_H = dispextern.h intervals.h composite.h GETLOADAVG_LIBS = @GETLOADAVG_LIBS@ @@ -413,7 +411,7 @@ $(LIBXML2_LIBS) $(LIBGPM) $(LIBRESOLV) $(LIBS_SYSTEM) \ $(LIBS_TERMCAP) $(GETLOADAVG_LIBS) $(SETTINGS_LIBS) $(LIBSELINUX_LIBS) \ $(FREETYPE_LIBS) $(FONTCONFIG_LIBS) $(LIBOTF_LIBS) $(M17N_FLT_LIBS) \ - $(LIBGNUTLS_LIBS) $(LIB_PTHREAD) $(LIB_PTHREAD_SIGMASK) \ + $(LIBGNUTLS_LIBS) $(LIB_PTHREAD) \ $(GFILENOTIFY_LIBS) $(LIB_MATH) $(LIBZ) all: emacs$(EXEEXT) $(OTHER_FILES) ------------------------------------------------------------ revno: 117187 fixes bug: http://debbugs.gnu.org/17622 committer: Eli Zaretskii branch nick: trunk timestamp: Thu 2014-05-29 17:52:47 +0300 message: Fix bug #17622 with crashes in mmap routines. src/buffer.c (init_buffer): Accept an argument 'initialized'. [USE_MMAP_FOR_BUFFERS]: If 'initialized' is non-zero, reset mmap_regions and mmap_fd, to avoid referencing stale data from the dump phase. Add an assertion for buffer text of buffers created in temacs before this function is called. (mmap_regions_1, mmap_fd_1): Remove unused variables. src/lisp.h (init_buffer): Update prototype. src/emacs.c (main): Pass 'initialized' as the argument to init_buffer. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-05-29 08:02:58 +0000 +++ src/ChangeLog 2014-05-29 14:52:47 +0000 @@ -1,3 +1,16 @@ +2014-05-29 Eli Zaretskii + + * buffer.c (init_buffer): Accept an argument 'initialized'. + [USE_MMAP_FOR_BUFFERS]: If 'initialized' is non-zero, reset + mmap_regions and mmap_fd, to avoid referencing stale data from the + dump phase. Add an assertion for buffer text of buffers created + in temacs before this function is called. (Bug#17622) + (mmap_regions_1, mmap_fd_1): Remove unused variables. + + * lisp.h (init_buffer): Update prototype. + + * emacs.c (main): Pass 'initialized' as the argument to init_buffer. + 2014-05-29 Dmitry Antipov * alloc.c (Fgarbage_collect): Fix compilation with === modified file 'src/buffer.c' --- src/buffer.c 2014-05-27 17:31:17 +0000 +++ src/buffer.c 2014-05-29 14:52:47 +0000 @@ -4703,11 +4703,6 @@ static int mmap_fd; -/* Temporary storage for mmap_set_vars, see there. */ - -static struct mmap_region *mmap_regions_1; -static int mmap_fd_1; - /* Page size on this system. */ static int mmap_page_size; @@ -5272,24 +5267,57 @@ } void -init_buffer (void) +init_buffer (int initialized) { char *pwd; Lisp_Object temp; ptrdiff_t len; #ifdef USE_MMAP_FOR_BUFFERS - { - struct buffer *b; - - /* We cannot dump buffers with meaningful addresses that can be - used by the dumped Emacs. We map new memory for them here. */ - FOR_EACH_BUFFER (b) - { - b->text->beg = NULL; - enlarge_buffer_text (b, 0); - } - } + if (initialized) + { + struct buffer *b; + +#ifndef WINDOWSNT + /* These must be reset in the dumped Emacs, to avoid stale + references to mmap'ed memory from before the dump. + + WINDOWSNT doesn't need this because it doesn't track mmap'ed + regions by hand (see w32heap.c, which uses system APIs for + that purpose), and thus doesn't use mmap_regions. */ + mmap_regions = NULL; + mmap_fd = -1; +#endif + + /* The dumped buffers reference addresses of buffer text + recorded by temacs, that cannot be used by the dumped Emacs. + We map new memory for their text here. + + Implementation note: the buffers we carry from temacs are: + " prin1", "*scratch*", " *Minibuf-0*", "*Messages*", and + " *code-conversion-work*". They are created by + init_buffer_once and init_window_once (which are not called + in the dumped Emacs), and by the first call to coding.c routines. */ + FOR_EACH_BUFFER (b) + { + b->text->beg = NULL; + enlarge_buffer_text (b, 0); + } + } + else + { + struct buffer *b; + + /* Only buffers with allocated buffer text should be present at + this point in temacs. */ + FOR_EACH_BUFFER (b) + { + eassert (b->text->beg != NULL); + } + } +#else /* not USE_MMAP_FOR_BUFFERS */ + /* Avoid compiler warnings. */ + initialized = initialized; #endif /* USE_MMAP_FOR_BUFFERS */ Fset_buffer (Fget_buffer_create (build_string ("*scratch*"))); === modified file 'src/emacs.c' --- src/emacs.c 2014-05-27 17:31:17 +0000 +++ src/emacs.c 2014-05-29 14:52:47 +0000 @@ -1376,7 +1376,8 @@ xputenv ("LANG=C"); #endif - init_buffer (); /* Init default directory of main buffer. */ + /* Init buffer storage and default directory of main buffer. */ + init_buffer (initialized); init_callproc_1 (); /* Must precede init_cmdargs and init_sys_modes. */ === modified file 'src/lisp.h' --- src/lisp.h 2014-05-27 17:31:17 +0000 +++ src/lisp.h 2014-05-29 14:52:47 +0000 @@ -3951,7 +3951,7 @@ extern Lisp_Object other_buffer_safely (Lisp_Object); extern Lisp_Object get_truename_buffer (Lisp_Object); extern void init_buffer_once (void); -extern void init_buffer (void); +extern void init_buffer (int); extern void syms_of_buffer (void); extern void keys_of_buffer (void); ------------------------------------------------------------ revno: 117186 committer: Dmitry Antipov branch nick: trunk timestamp: Thu 2014-05-29 12:02:58 +0400 message: * alloc.c (Fgarbage_collect): Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-05-29 04:47:01 +0000 +++ src/ChangeLog 2014-05-29 08:02:58 +0000 @@ -1,3 +1,8 @@ +2014-05-29 Dmitry Antipov + + * alloc.c (Fgarbage_collect): Fix compilation with + GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE. + 2014-05-29 Paul Eggert * frame.c, frame.h (frame_char_to_pixel_position) === modified file 'src/alloc.c' --- src/alloc.c 2014-05-24 12:02:25 +0000 +++ src/alloc.c 2014-05-29 08:02:58 +0000 @@ -5847,8 +5847,13 @@ end = stack_grows_down_p ? (char *) &j + sizeof j : (char *) &j; #endif /* not GC_SAVE_REGISTERS_ON_STACK */ #endif /* not HAVE___BUILTIN_UNWIND_INIT */ -#endif /* GC_MARK_STACK */ return garbage_collect_1 (end); +#elif (GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE) + /* Old GCPROs-based method without stack marking. */ + return garbage_collect_1 (NULL); +#else + emacs_abort (); +#endif /* GC_MARK_STACK */ } /* Mark Lisp objects in glyph matrix MATRIX. Currently the