1. 10 Sep, 2014 2 commits
    • Paul Eggert's avatar
    • Paul Eggert's avatar
      Improve the experimental local and scoped allocation. · 11e28ab0
      Paul Eggert authored
      * configure.ac (HAVE_STRUCT_ATTRIBUTE_ALIGNED)
      (HAVE_STATEMENT_EXPRESSIONS): New configure-time checks.
      * src/alloc.c (local_string_init, local_vector_init):
      New functions, defined if USE_LOCAL_ALLOCATORS.
      Mostly, these are moved here from lisp.h, as it's not
      clear it's worth making them inline.
      * src/lisp.h (USE_STACK_LISP_OBJECTS): Default to false.
      USE_STACK_LISP_OBJECTS, not on a laundry list.
      (local_string_init, local_vector_init): New decls.
      (union Aligned_Cons): New type.
      (scoped_cons): Use it.  Give up on the char trick, as it's a too
      much of a maintenance hassle; if someone wants this speedup
      they'll just need to convince their compiler to align properly.
      Conversely, use the speedup if struct Lisp_Cons happens to
      be aligned even without a directive.  Better yet, help it along
      by using union Aligned_Cons rather than struct Lisp_Cons.
      (pointer_valid_for_lisp_object): Remove.  This check is not
      necessary, since make_lisp_ptr is already doing it.  All uses removed.
      (local_vector_init, local_string_init): Move to alloc.c.
      (build_local_vector): Remove this awkward macro, replacing with ...
      (make_local_vector): New macro, which acts more like a function.
      Use statement expressions and use __COUNTER__ to avoid macro
      capture.  Fall back on functions if these features are not supported.
      (build_local_string, make_local_string): Likewise.
  2. 09 Sep, 2014 6 commits
  3. 08 Sep, 2014 7 commits
  4. 07 Sep, 2014 11 commits
    • Paul Eggert's avatar
      Fix bug uncovered by changing alloca to auto buffer. · 4612d1ea
      Paul Eggert authored
      * coding.c (growable_destination): New function.
      (produce_chars): Use it for sanity checks.  Do not fiddle with
      dst_end if the source and destination are both nil, as it's
      the caller's responsibility to avoid overlap.
      * keyboard.c (read_decoded_event_from_main_queue):
      The destination must be MAX_MULTIBYTE_LENGTH times the max source
      length, not 4 times, to prevent decode_coding_c_string from trying
      to reallocate a destination.  This removes the need for the FIXME.
      Fixes: debbugs:18410
    • Paul Eggert's avatar
      * callproc.c (exec_failed) [DOS_NT]: Define a dummy. · d5e25ad1
      Paul Eggert authored
      All callers simplified.  Add a comment about exec_failed, vfork,
      and alloca.
    • Paul Eggert's avatar
      Adjust drag-and-drop fix when window is above top. · bee40718
      Paul Eggert authored
      * xselect.c (x_fill_property_data): Don't let sign bit of negative
      XCDR bleed into XCAR's encoded value.  Improve checks for
      out-of-range data while we're at it.
      Fixes: debbugs:18383
    • Jan Djärv's avatar
      * xselect.c (x_fill_property_data): Handle negative XCDR when data · eee8ec84
      Jan Djärv authored
      is CONSP.
      Fixes: debbugs:18303
    • Eli Zaretskii's avatar
      Fix bug #18419 with disappearing line numbers when minibuffer is resized. · 938aed6e
      Eli Zaretskii authored
       src/dispnew.c (prepare_desired_row): When MODE_LINE_P is zero,
       always make sure the marginal areas of the row are in sync with
       what the window wants.
    • Eli Zaretskii's avatar
      Fix the MS-Windows build broken by SAFE_ALLOCA changes. · 970d21e8
      Eli Zaretskii authored
       src/callproc.c (child_setup) [WINDOWSNT]: Don't call exec_failed if
       'alloca' gets passed arguments larger than MAX_ALLOCA.
       src/font.c (MAX): Define if not defined elsewhere.
    • Paul Eggert's avatar
      * keyboard.c (read_decoded_event_from_main_queue): Reinstitute alloca · 2b95a8ef
      Paul Eggert authored
      here for destination buffer, to work around what appears to be a
      bug in decode_coding_c_string when the source and destination are
      both C strings.
      * keyboard.c (echo_add_key, menu_bar_items, tool_bar_items)
    • Michael Albinus's avatar
      * strings.texi (Text Comparison): Describe `string-collate-equalp' · d3cb31cb
      Michael Albinus authored
      and `string-collate-lessp'.
    • Paul Eggert's avatar
      Expand @AM_DEFAULT_VERBOSITY@ even if Automake is old. · 6726de52
      Paul Eggert authored
      * configure.ac: Assume verbose output for older Automake.
      Fixes: debbugs:18415
    • Michael Albinus's avatar
      * automated/fns-tests.el (fns-tests--collate-enabled-p): New function. · 47ae4ce3
      Michael Albinus authored
      (fns-tests-collate-strings, fns-tests-collate-sort): Use it.
    • Paul Eggert's avatar
      Use SAFE_ALLOCA etc. to avoid unbounded stack allocation. · b3bf18b3
      Paul Eggert authored
      This follows up on the recent thread in emacs-devel on alloca; see:
      This patch also cleans up alloca-related glitches noted while
      examining the code looking for unbounded alloca.
      * alloc.c (listn):
      * callproc.c (init_callproc):
      Rewrite to avoid need for alloca.
      * buffer.c (mouse_face_overlay_overlaps)
      * buffer.h (GET_OVERLAYS_AT):
      * coding.c (make_subsidiaries):
      * doc.c (Fsnarf_documentation):
      * editfns.c (Fuser_full_name):
      * fileio.c (Ffile_name_directory, Fexpand_file_name)
      (search_embedded_absfilename, Fsubstitute_in_file_name):
      * fns.c (Fmake_hash_table):
      * font.c (font_vconcat_entity_vectors, font_update_drivers):
      * fontset.c (fontset_pattern_regexp, Ffontset_info):
      * frame.c (Fmake_terminal_frame, x_set_frame_parameters)
      (xrdb_get_resource, x_get_resource_string):
      * ftfont.c (ftfont_get_charset, ftfont_check_otf, ftfont_drive_otf):
      * ftxfont.c (ftxfont_draw):
      * image.c (xbm_load, xpm_load, jpeg_load_body):
      * keyboard.c (echo_add_key, menu_bar_items, tool_bar_items):
      * keymap.c (Fdescribe_buffer_bindings, describe_map):
      * lread.c (openp):
      * menu.c (digest_single_submenu, find_and_call_menu_selection)
      * print.c (PRINTFINISH):
      * process.c (Fformat_network_address):
      * scroll.c (do_scrolling, do_direct_scrolling, scrolling_1):
      * search.c (search_buffer, Fmatch_data, Fregexp_quote):
      * sound.c (wav_play, au_play):
      * syntax.c (skip_chars):
      * term.c (tty_menu_activate, tty_menu_show):
      * textprop.c (get_char_property_and_overlay):
      * window.c (Fset_window_configuration):
      * xdisp.c (safe__call, next_overlay_change, vmessage)
      (compute_overhangs_and_x, draw_glyphs, note_mouse_highlight):
      * xfaces.c (face_at_buffer_position):
      * xmenu.c (x_menu_show):
      Use SAFE_ALLOCA etc. instead of plain alloca, since the
      allocation size isn't bounded.
      * callint.c (Fcall_interactively): Redo memory_full check
      so that it can be done at compile-time on some platforms.
      * coding.c (MAX_LOOKUP_MAX): New constant.
      (get_translation_table): Use it.
      * callproc.c (call_process): Use SAFE_NALLOCA instead of
      SAFE_ALLOCA, to catch integer overflows on size calculation.
      (exec_failed) [!DOS_NT]: New function.
      (child_setup) [!DOS_NT]: Use it.
      * editfns.c (Ftranspose_regions):
      Hoist USE_SAFE_ALLOC + SAFE_FREE out of 'if'.
      * editfns.c (check_translation):
      Allocate larger buffers on the heap.
      * eval.c (internal_lisp_condition_case):
      Check for MAX_ALLOCA overflow.
      * fns.c (sort_vector): Use SAFE_ALLOCA_LISP rather than Fmake_vector.
      (Fbase64_encode_region, Fbase64_decode_region):
      Avoid unnecessary calls to SAFE_FREE before 'error'.
      * buffer.c (mouse_face_overlay_overlaps):
      * editfns.c (Fget_pos_property, check_translation):
      * eval.c (Ffuncall):
      * font.c (font_unparse_xlfd, font_find_for_lface):
      * ftfont.c (ftfont_drive_otf):
      * keyboard.c (echo_add_key, read_decoded_event_from_main_queue)
      (menu_bar_items, tool_bar_items):
      * sound.c (Fplay_sound_internal):
      * xdisp.c (load_overlay_strings, dump_glyph_row):
      Use an ordinary auto buffer rather than alloca, since the
      allocation size is fixed and small.
      * ftfont.c: Include <c-strcase.h>.
      (matching_prefix): New function.
      (get_adstyle_property): Use it, to avoid need for alloca.
      * keyboard.c (echo_add_key):
      * keymap.c (describe_map): Use ptrdiff_t, not int.
      * keyboard.c (echo_add_key): Prefer sizeof to strlen.
      * keymap.c (Fdescribe_buffer_bindings): Use SBYTES, not SCHARS,
      when counting bytes.
      * lisp.h (xlispstrdupa): Remove, replacing with ...
      (SAFE_ALLOCA_STRING): ... new macro with different API.
      This fixes a portability problem, namely, alloca result
      passed to another function.  All uses changed.
      not MAX_ALLOCA - 1.
      (REGEX_ALLOCATE): New macros.
      (REGEX_FREE_STACK, FREE_VARIABLES, re_match_2_internal):
      Use them.
      * xdisp.c (message3): Use SAFE_ALLOCA_STRING rather than doing it
      by hand.
      (decode_mode_spec_coding): Store directly into buf rather than
      into an alloca temporary and copying the temporary to the buf.
      Fixes: debbugs:18410
  5. 06 Sep, 2014 2 commits
    • Eli Zaretskii's avatar
      Remove unused variable EMACS_HEAPSIZE from src/Makefile.in. · 930fb80f
      Eli Zaretskii authored
       src/Makefile.in (EMACS_HEAPSIZE): Remove, no longer used.  (Bug#18416)
       ChangeLog: Mention explicitly the removal of EMACS_HEAPSIZE.
    • Leo Liu's avatar
      Add vector qpattern to pcase · e872d52c
      Leo Liu authored
      * doc/lispref/control.texi (Pattern matching case statement): Document vector
      * etc/NEWS: Mention vector qpattern for pcase.  (Bug#18327).
      * lisp/emacs-lisp/pcase.el (pcase): Doc fix.
      (pcase--split-vector): New function.
      (pcase--q1): Support vector qpattern.  (Bug#18327)
  6. 05 Sep, 2014 7 commits
  7. 04 Sep, 2014 5 commits