Now on revision 110349. ------------------------------------------------------------ revno: 110349 committer: Paul Eggert branch nick: trunk timestamp: Tue 2012-10-02 12:38:10 -0700 message: * profiler.c (handle_profiler_signal): Fix a malloc race that caused Emacs to hang on Fedora 17 when profiling Lisp. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-10-02 18:51:51 +0000 +++ src/ChangeLog 2012-10-02 19:38:10 +0000 @@ -1,3 +1,8 @@ +2012-10-02 Paul Eggert + + * profiler.c (handle_profiler_signal): Fix a malloc race + that caused Emacs to hang on Fedora 17 when profiling Lisp. + 2012-10-02 Jan Djärv * nsterm.m (windowDidEnterFullScreen): Remove fprintf. === modified file 'src/profiler.c' --- src/profiler.c 2012-10-02 06:30:40 +0000 +++ src/profiler.c 2012-10-02 19:38:10 +0000 @@ -238,6 +238,7 @@ cpu_gc_count = saturated_add (cpu_gc_count, 1); else { + Lisp_Object oquit; EMACS_INT count = 1; #ifdef HAVE_TIMER_SETTIME if (profiler_timer_ok) @@ -247,8 +248,16 @@ count += overruns; } #endif + /* record_backtrace uses hash functions that call Fequal, which + uses QUIT, which can call malloc, which can cause disaster in + a signal handler. So inhibit QUIT. */ + oquit = Vinhibit_quit; + Vinhibit_quit = Qt; + eassert (HASH_TABLE_P (cpu_log)); record_backtrace (XHASH_TABLE (cpu_log), count); + + Vinhibit_quit = oquit; } } ------------------------------------------------------------ revno: 110348 committer: Jan D. branch nick: trunk timestamp: Tue 2012-10-02 20:51:51 +0200 message: * nsterm.m (windowDidEnterFullScreen): Remove fprintf. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-10-02 17:55:29 +0000 +++ src/ChangeLog 2012-10-02 18:51:51 +0000 @@ -1,3 +1,7 @@ +2012-10-02 Jan Djärv + + * nsterm.m (windowDidEnterFullScreen): Remove fprintf. + 2012-10-02 Eli Zaretskii * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be === modified file 'src/nsterm.m' --- src/nsterm.m 2012-10-01 06:36:54 +0000 +++ src/nsterm.m 2012-10-02 18:51:51 +0000 @@ -5871,7 +5871,6 @@ { [self setFSValue: FULLSCREEN_BOTH]; #ifndef NEW_STYLE_FS - fprintf(stderr, "%s %d\n", __func__, FRAME_PIXEL_WIDTH (emacsframe)); [self windowDidBecomeKey:notification]; #endif } ------------------------------------------------------------ revno: 110347 committer: Eli Zaretskii branch nick: trunk timestamp: Tue 2012-10-02 19:55:29 +0200 message: Fix compilation warnings in the MS-Windows build. src/w32proc.c (sys_wait): Declare 'signame' 'const char *', to be consistent with the change in return value of 'safe_strsignal'. nt/preprep.c (RVA_TO_PTR): Cast the result to 'void *', to avoid compiler warnings when using the value. diff: === modified file 'nt/ChangeLog' --- nt/ChangeLog 2012-10-01 11:37:37 +0000 +++ nt/ChangeLog 2012-10-02 17:55:29 +0000 @@ -1,3 +1,8 @@ +2012-10-02 Eli Zaretskii + + * preprep.c (RVA_TO_PTR): Cast the result to 'void *', to avoid + compiler warnings when using the value. + 2012-10-01 Eli Zaretskii * preprep.c (RVA_TO_PTR): Use 'unsigned char *' instead of === modified file 'nt/preprep.c' --- nt/preprep.c 2012-10-01 11:37:37 +0000 +++ nt/preprep.c 2012-10-02 17:55:29 +0000 @@ -288,7 +288,7 @@ ((DWORD_PTR)(rva) - (section)->VirtualAddress) #define RVA_TO_PTR(var,section,filedata) \ - ((unsigned char *)(RVA_TO_OFFSET(var,section) + (filedata)->file_base)) + ((void *)((unsigned char *)(RVA_TO_OFFSET(var,section) + (filedata)->file_base))) /* Convert address in executing image to RVA. */ #define PTR_TO_RVA(ptr) ((DWORD_PTR)(ptr) - (DWORD_PTR) GetModuleHandle (NULL)) === modified file 'src/ChangeLog' --- src/ChangeLog 2012-10-02 06:55:27 +0000 +++ src/ChangeLog 2012-10-02 17:55:29 +0000 @@ -1,3 +1,8 @@ +2012-10-02 Eli Zaretskii + + * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be + consistent with the change in return value of 'safe_strsignal'. + 2012-10-02 Paul Eggert Prefer plain 'static' to 'static inline' (Bug#12541). === modified file 'src/w32proc.c' --- src/w32proc.c 2012-10-01 21:09:30 +0000 +++ src/w32proc.c 2012-10-02 17:55:29 +0000 @@ -1132,7 +1132,7 @@ else if (WIFSIGNALED (retval)) { int code = WTERMSIG (retval); - char *signame; + const char *signame; synchronize_system_messages_locale (); signame = strsignal (code); ------------------------------------------------------------ revno: 110346 committer: Chong Yidong branch nick: trunk timestamp: Tue 2012-10-02 23:21:47 +0800 message: Incorporate Semantic's hideif components into hideif.el (replacing advice) * progmodes/hideif.el (hif-lookup, hif-defined): Handle semantic-c-takeover-hideif. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-10-02 06:30:40 +0000 +++ lisp/ChangeLog 2012-10-02 15:21:47 +0000 @@ -1,3 +1,8 @@ +2012-10-02 Chong Yidong + + * progmodes/hideif.el (hif-lookup, hif-defined): Handle + semantic-c-takeover-hideif. + 2012-10-02 Paul Eggert Change sampling interval units from ms to ns. === modified file 'lisp/progmodes/hideif.el' --- lisp/progmodes/hideif.el 2012-08-22 07:17:52 +0000 +++ lisp/progmodes/hideif.el 2012-10-02 15:21:47 +0000 @@ -329,16 +329,23 @@ "Prepend (var value) pair to hide-ifdef-env." (setq hide-ifdef-env (cons (cons var value) hide-ifdef-env))) +(declare-function semantic-c-hideif-lookup "semantic/bovine/c" (var)) +(declare-function semantic-c-hideif-defined "semantic/bovine/c" (var)) (defun hif-lookup (var) - ;; (message "hif-lookup %s" var) - (let ((val (assoc var hide-ifdef-env))) - (if val - (cdr val) - hif-undefined-symbol))) + (or (when (bound-and-true-p semantic-c-takeover-hideif) + (semantic-c-hideif-lookup var)) + (let ((val (assoc var hide-ifdef-env))) + (if val + (cdr val) + hif-undefined-symbol)))) (defun hif-defined (var) - (if (assoc var hide-ifdef-env) 1 0)) + (cond + ((bound-and-true-p semantic-c-takeover-hideif) + (semantic-c-hideif-defined var)) + ((assoc var hide-ifdef-env) 1) + (t 0))) ;;===%%SF%% evaluation (End) === ------------------------------------------------------------ revno: 110345 fixes bug: http://debbugs.gnu.org/12541 committer: Paul Eggert branch nick: trunk timestamp: Mon 2012-10-01 23:55:27 -0700 message: Prefer plain 'static' to 'static inline'. * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category) (bidi_set_sor_type, bidi_push_embedding_level) (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it) (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state) (bidi_cache_search, bidi_cache_ensure_space) (bidi_cache_iterator_state, bidi_cache_find) (bidi_peek_at_next_level, bidi_set_paragraph_end) (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char) (bidi_explicit_dir_char, bidi_resolve_neutral_1): Now 'static', not 'static inline'. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-10-02 06:30:40 +0000 +++ src/ChangeLog 2012-10-02 06:55:27 +0000 @@ -1,5 +1,17 @@ 2012-10-02 Paul Eggert + Prefer plain 'static' to 'static inline' (Bug#12541). + * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category) + (bidi_set_sor_type, bidi_push_embedding_level) + (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it) + (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state) + (bidi_cache_search, bidi_cache_ensure_space) + (bidi_cache_iterator_state, bidi_cache_find) + (bidi_peek_at_next_level, bidi_set_paragraph_end) + (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char) + (bidi_explicit_dir_char, bidi_resolve_neutral_1): + Now 'static', not 'static inline'. + Count overruns when profiling; change units to ns. * profiler.c (handle_profiler_signal): Count sampling intervals, not ms. Give extra weight to samples after overruns, to attempt to count === modified file 'src/bidi.c' --- src/bidi.c 2012-10-01 06:19:52 +0000 +++ src/bidi.c 2012-10-02 06:55:27 +0000 @@ -96,7 +96,7 @@ /* Return the bidi type of a character CH, subject to the current directional OVERRIDE. */ -static inline bidi_type_t +static bidi_type_t bidi_get_type (int ch, bidi_dir_t override) { bidi_type_t default_type; @@ -145,14 +145,14 @@ } } -static inline void +static void bidi_check_type (bidi_type_t type) { eassert (UNKNOWN_BT <= type && type <= NEUTRAL_ON); } /* Given a bidi TYPE of a character, return its category. */ -static inline bidi_category_t +static bidi_category_t bidi_get_category (bidi_type_t type) { switch (type) @@ -226,7 +226,7 @@ embedding levels on either side of the run boundary. Also, update the saved info about previously seen characters, since that info is generally valid for a single level run. */ -static inline void +static void bidi_set_sor_type (struct bidi_it *bidi_it, int level_before, int level_after) { int higher_level = (level_before > level_after ? level_before : level_after); @@ -257,7 +257,7 @@ /* Push the current embedding level and override status; reset the current level to LEVEL and the current override status to OVERRIDE. */ -static inline void +static void bidi_push_embedding_level (struct bidi_it *bidi_it, int level, bidi_dir_t override) { @@ -269,7 +269,7 @@ /* Pop the embedding level and directional override status from the stack, and return the new level. */ -static inline int +static int bidi_pop_embedding_level (struct bidi_it *bidi_it) { /* UAX#9 says to ignore invalid PDFs. */ @@ -279,7 +279,7 @@ } /* Record in SAVED_INFO the information about the current character. */ -static inline void +static void bidi_remember_char (struct bidi_saved_info *saved_info, struct bidi_it *bidi_it) { @@ -295,7 +295,7 @@ /* Copy the bidi iterator from FROM to TO. To save cycles, this only copies the part of the level stack that is actually in use. */ -static inline void +static void bidi_copy_it (struct bidi_it *to, struct bidi_it *from) { /* Copy everything from the start through the active part of @@ -340,7 +340,7 @@ intact. This is called when the cached information is no more useful for the current iteration, e.g. when we were reseated to a new position on the same object. */ -static inline void +static void bidi_cache_reset (void) { bidi_cache_idx = bidi_cache_start; @@ -351,7 +351,7 @@ iterator for reordering a buffer or a string that does not come from display properties, because that means all the previously cached info is of no further use. */ -static inline void +static void bidi_cache_shrink (void) { if (bidi_cache_size > BIDI_CACHE_CHUNK) @@ -362,7 +362,7 @@ bidi_cache_reset (); } -static inline void +static void bidi_cache_fetch_state (ptrdiff_t idx, struct bidi_it *bidi_it) { int current_scan_dir = bidi_it->scan_dir; @@ -379,7 +379,7 @@ level less or equal to LEVEL. if LEVEL is -1, disregard the resolved levels in cached states. DIR, if non-zero, means search in that direction from the last cache hit. */ -static inline ptrdiff_t +static ptrdiff_t bidi_cache_search (ptrdiff_t charpos, int level, int dir) { ptrdiff_t i, i_start; @@ -484,7 +484,7 @@ return -1; } -static inline void +static void bidi_cache_ensure_space (ptrdiff_t idx) { /* Enlarge the cache as needed. */ @@ -506,7 +506,7 @@ } } -static inline void +static void bidi_cache_iterator_state (struct bidi_it *bidi_it, bool resolved) { ptrdiff_t idx; @@ -563,7 +563,7 @@ bidi_cache_idx = idx + 1; } -static inline bidi_type_t +static bidi_type_t bidi_cache_find (ptrdiff_t charpos, int level, struct bidi_it *bidi_it) { ptrdiff_t i = bidi_cache_search (charpos, level, bidi_it->scan_dir); @@ -583,7 +583,7 @@ return UNKNOWN_BT; } -static inline int +static int bidi_peek_at_next_level (struct bidi_it *bidi_it) { if (bidi_cache_idx == bidi_cache_start || bidi_cache_last_idx == -1) @@ -786,7 +786,7 @@ /* Do whatever UAX#9 clause X8 says should be done at paragraph's end. */ -static inline void +static void bidi_set_paragraph_end (struct bidi_it *bidi_it) { bidi_it->invalid_levels = 0; @@ -868,7 +868,7 @@ /* Count bytes in string S between BEG/BEGBYTE and END. BEG and END are zero-based character positions in S, BEGBYTE is byte position corresponding to BEG. UNIBYTE means S is a unibyte string. */ -static inline ptrdiff_t +static ptrdiff_t bidi_count_bytes (const unsigned char *s, const ptrdiff_t beg, const ptrdiff_t begbyte, const ptrdiff_t end, bool unibyte) { @@ -896,7 +896,7 @@ non-NULL, fetch the character from string S; otherwise fetch the character from the current buffer. UNIBYTE means S is a unibyte string. */ -static inline int +static int bidi_char_at_pos (ptrdiff_t bytepos, const unsigned char *s, bool unibyte) { if (s) @@ -924,7 +924,7 @@ u+2029 to handle it as a paragraph separator. STRING->s is the C string to iterate, or NULL if iterating over a buffer or a Lisp string; in the latter case, STRING->lstring is the Lisp string. */ -static inline int +static int bidi_fetch_char (ptrdiff_t bytepos, ptrdiff_t charpos, ptrdiff_t *disp_pos, int *disp_prop, struct bidi_string_data *string, bool frame_window_p, ptrdiff_t *ch_len, ptrdiff_t *nchars) @@ -1314,7 +1314,7 @@ The rest of this file constitutes the core of the UBA implementation. ***********************************************************************/ -static inline bool +static bool bidi_explicit_dir_char (int ch) { bidi_type_t ch_type; @@ -1837,7 +1837,7 @@ /* Resolve the type of a neutral character according to the type of surrounding strong text and the current embedding level. */ -static inline bidi_type_t +static bidi_type_t bidi_resolve_neutral_1 (bidi_type_t prev_type, bidi_type_t next_type, int lev) { /* N1: European and Arabic numbers are treated as though they were R. */