1. 15 Jun, 2019 2 commits
    • Eli Zaretskii's avatar
      Update hash value in pdumper.c · ca0b4edf
      Eli Zaretskii authored
      * src/pdumper.c (dump_fwd_buffer_obj) [CHECK_STRUCTS]: Update
      the hash in HASH_Lisp_Buffer_Objfwd.  (Bug#36225)
      ca0b4edf
    • Eli Zaretskii's avatar
      Improve error message when dmpstruct.h needs to be updated · 34f01bf8
      Eli Zaretskii authored
      * src/pdumper.c (dump_cons, dump_interval_tree, dump_string)
      (dump_marker, dump_overlay, dump_finalizer)
      (dump_bignum, dump_float, dump_fwd_int, dump_fwd_bool)
      (dump_fwd_obj, dump_fwd_buffer_obj, dump_fwd_kboard_obj)
      (dump_fwd, dump_blv, dump_symbol, dump_vectorlike_generic)
      (dump_hash_table, dump_buffer, dump_bool_vector, dump_subr)
      (dump_vectorlike, dump_object, dump_charset) [CHECK_STRUCTS]:
      Make the error message more specific where to find the comment
      to CHECK_STRUCTS.
      34f01bf8
  2. 25 Apr, 2019 1 commit
    • Paul Eggert's avatar
      Port to Oracle Developer Studio 12.6 · 69947311
      Paul Eggert authored
      This compiler is a bit pickier about checking conformance to
      the C standard, ranging from syntax trivia (no extra ";" at
      the top level) to portability trivia (warnings re conversion
      between function and data pointers) to more-important stuff
      like lack of support for some __attribute__ usages.
      * src/dynlib.c (dynlib_addr): First argument is a function
      pointer, not a data pointer.  All callers changed.
      * src/emacs-module.c (module_function_address):
      Return module_funcptr, not void *.  All uses changed.
      * src/lisp.h (module_funcptr) [HAVE_MODULES]: New type.
      * src/lread.c (union ieee754_double): Don’t assume the usual
      semantics for converting signed to unsigned int when initializing
      a bitfield, as the Oracle compiler complains and the C standard
      is unclear.
      * src/pdumper.c (ALLOW_IMPLICIT_CONVERSION): Make it clearer
      that -Wsign-conversion is disabled everywhere in this file.
      (dump_trace, dump_tailq_prepend, dump_tailq_append):
      Don’t assume __attribute__.
      (dump_object_self_representing_p): Don’t disable conversion
      warnings; it’s not needed here.
      (DEFINE_FROMLISP_FUNC): Avoid possible signal in integer
      conversion from unsigned to signed.
      (DEFINE_FROMLISP_FUNC, finish_dump_pvec): Avoid warning about
      unreachable statements on platforms not supporting the
      __attribute__.
      (intmax_t_from_lisp, intmax_t_to_lisp, dump_off_from_lisp)
      (dump_off_to_lisp, dump_emacs_reloc_immediate_lv)
      (dump_emacs_reloc_immediate_ptrdiff_t)
      (dump_emacs_reloc_immediate_intmax_t)
      (dump_emacs_reloc_immediate_int, dump_emacs_reloc_immediate_bool):
      Omit stray semicolon that violates C standard.
      (dump_metadata_for_pdumper): Add cast to pacify compiler complaining
      about conversion from function pointer to data pointer.
      (Fdump_emacs_portable): Do not use CALLN to call a function
      with zero arguments, as C99 prohibits empty initializers.
      * src/xdisp.c (syms_of_xdisp): Do not nest calls to pure_list,
      to work around a bug in Oracle Developer Studio 12.6.
      69947311
  3. 22 Apr, 2019 2 commits
    • Paul Eggert's avatar
      Fix drain_reloc_list alignment bug · e85bff0b
      Paul Eggert authored
      * src/pdumper.c (dump_charset): Use alignof (struct charset),
      not alignof (int), since struct charset might be more strictly
      aligned than int.  I think this is just a minor performance
      issue, but we might as well use the correct alignment.
      (drain_reloc_list): Use an alignment instead of a size for the
      output alignment.  This prevents undefined behavior when
      alignof (struct emacs_reloc) == 8 and sizeof (dump_off) == 4
      when building on x86-64 with gcc -fsanitize=undefined.
      e85bff0b
    • Paul Eggert's avatar
      Port dump_bitset_clear to -fsanitize=undefined · 4a5ed6b0
      Paul Eggert authored
      * src/pdumper.c (dump_bitset_clear):
      Pacify -fsanitize=undefined by avoiding memset (NULL, x, 0),
      which strictly speaking has undefined behavior although it
      works on all production platforms I know.
      4a5ed6b0
  4. 21 Apr, 2019 1 commit
    • Paul Eggert's avatar
      Fix double-free in pdumper · 2ea55c27
      Paul Eggert authored
      Revert the double-free bug that I introduced in
      2019-03-11T15:20:54Z!eggert@cs.ucla.edu.
      * src/pdumper.c (dump_mmap_reset): Do not free the private member;
      that’s the release function’s job.
      (dump_mm_heap_cb_release): Free cb if its refcount goes to zero.
      (dump_mmap_contiguous_heap): Mention memory leak in comment.
      2ea55c27
  5. 20 Apr, 2019 1 commit
  6. 19 Apr, 2019 2 commits
    • Philipp Stephani's avatar
      Remove some #ifdefs for user pointers. · e7cb6eea
      Philipp Stephani authored
      Even if Emacs is compiled without module support, we don't have to
      comment out every bit of user pointer support.  Defining the basic
      structures and functions and detecting user pointers in switch
      statements is harmless, and we're already doing the same for module
      functions.  Removing these #ifdefs makes the code a bit easier to
      read.
      
      * src/lisp.h (PVEC_USER_PTR, struct Lisp_User_Ptr, USER_PTRP)
      (XUSER_PTR): Define unconditionally.
      
      * src/data.c (Ftype_of):
      * src/alloc.c (cleanup_vector):
      * src/print.c (print_vectorlike):
      * src/pdumper.c (dump_vectorlike): Remove #ifdef for user pointers.
      e7cb6eea
    • Paul Eggert's avatar
      Fix dump_map_file on unusual platforms · 7d84056d
      Paul Eggert authored
      * src/pdumper.c (dump_map_file): Fix recently-introduced typo
      on platforms that support neither POSIX nor MS-Windows VM.
      7d84056d
  7. 18 Apr, 2019 1 commit
    • Paul Eggert's avatar
      Mark _Noreturn error functions as cold · 6d6c55db
      Paul Eggert authored
      On my platform this made ‘make compile-always’ 1.3% faster.
      Suggested by Alex Gramiak in:
      https://lists.gnu.org/r/emacs-devel/2019-04/msg00684.html
      * configure.ac (nw): Don’t use -Wsuggest-attribute=cold.
      * lib-src/make-docfile.c (write_globals):
      Mark noreturn functions as cold.
      * src/callproc.c (exec_failed):
      * src/data.c (wrong_length_argument, wrong_type_argument):
      * src/emacs-module.c (module_abort):
      * src/emacs.c (terminate_due_to_signal):
      * src/eval.c (unwind_to_catch):
      * src/image.c (my_png_error, my_error_exit):
      * src/json.c (json_out_of_memory, json_parse_error):
      * src/keyboard.c (quit_throw_to_read_char, user_error):
      * src/lisp.h (die, wrong_type_argument, wrong_choice)
      (args_out_of_range, args_out_of_range_3, circular_list)
      (buffer_overflow, memory_full, buffer_memory_full)
      (string_overflow, xsignal, xsignal0, xsignal1, xsignal2)
      (xsignal3, signal_error, overflow_error, error, verror)
      (nsberror, report_file_errno, report_file_error)
      (report_file_notify_error, terminate_due_to_signal)
      (emacs_abort, fatal):
      * src/lread.c (load_error_old_style_backquotes)
      (end_of_file_error, invalid_syntax):
      * src/pdumper.c (error_unsupported_dump_object):
      * src/puresize.h (pure_write_error):
      * src/search.c (matcher_overflow):
      * src/sound.c (sound_perror, alsa_sound_perror):
      * src/sysdep.c (handle_arith_signal):
      * src/systime.h (time_overflow):
      * src/term.c (maybe_fatal, vfatal):
      * src/textprop.c (text_read_only):
      * src/timefns.c (invalid_time_zone_specification)
      (time_error, invalid_hz):
      * src/xterm.c (x_connection_closed):
      Use AVOID instead of _Noreturn void, so that it’s marked cold.
      * src/conf_post.h (__has_attribute_cold) [!__has_attribute]:
      New macro.
      (ATTRIBUTE_COLD): New macro.
      * src/frame.h (WINDOW_SYSTEM_RETURN): Add ATTRIBUTE_COLD.
      * src/lisp.h (AVOID): New macro.
      * src/xterm.c: Omit unnecessary static decls, so that we needn’t
      worry about which functions should be marked cold.
      (x_io_error_quitter): Mark as cold.
      6d6c55db
  8. 11 Apr, 2019 1 commit
    • Paul Eggert's avatar
      Bring back dmpstruct.h · 9994bf17
      Paul Eggert authored
      Bring back the dmpstruct.h checking, and use it when
      --enable-checking=structs is specified.  The checking can be helpful
      to some developers, although it gets in the way of others and is
      not needed for ordinary tarball builds.
      * src/dmpstruct.awk: Restore this file, with mode 644 not 755.
      * configure.ac: New option-arg --enable-checking=structs,
      implied by --enable-checking.
      (CHECK_STRUCTS): New macro and var.
      * src/Makefile.in (CHECK_STRUCTS): New macro.
      (dmpstruct_headers, dmpstruct.h, dmpstruct.h):
      Restore these macros and rules.
      (pdumper.o): Restore this dependency if $(CHECK_STRUCTS) is true.
      (mostlyclean): Remove dmpstruct.h.
      * src/pdumper.c [CHECK_STRUCTS]: Include dmpstruct.h,
      and restore checks against hashes.
      9994bf17
  9. 09 Apr, 2019 2 commits
    • Paul Eggert's avatar
      Remove assumption of uint64_t etc. in portable code · e44ff2de
      Paul Eggert authored
      C11 doesn’t guarantee the existence of types like uint64_t,
      so avoid these types in portable code, as it’s easy to do so.
      There’s no need to avoid the types in w32-specific code,
      since w32 is guaranteed to have them.
      * lib-src/make-fingerprint.c (main):
      * src/fingerprint-dummy.c:
      * src/fingerprint.h:
      * src/pdumper.c (dump_fingerprint, struct dump_header):
      Prefer unsigned char to uint8_t in portable code, as either will do.
      Put an "#include <config.h>" in fingerprint.c files, so
      that the corresponding .o file is rebuilt after ./configure is run.
      * lib-src/make-fingerprint.c (main):
      Simplify loop.
      * src/Makefile.in (fingerprint.c): Update atomically.
      * src/pdumper.c: Omit unnecessary check that off_t is the same
      size as int32_t or int64_t, as the code does not rely on this
      assumption.
      (dump_off): Use int_least32_t, not int32_t.
      (struct dump_reloc): Use unsigned int, not uint32_t.
      (dump_anonymous_allocate_w32, dump_anonymous_allocate_posix)
      (dump_anonymous_allocate, dump_map_file_w32, dump_map_file_posix)
      (dump_map_file:
      Do the sanity checks at compile time, not at run-time, to avoid
      usage of uint64_t etc. on non-w32 platforms.
      e44ff2de
    • Paul Eggert's avatar
      Remove dmpstruct.h · 44a39e3e
      Paul Eggert authored
      The hassles of updating the dmpstruct.h-using code bit me again.
      These updates are more trouble than they’re worth.  See:
      https://lists.gnu.org/r/emacs-devel/2019-03/msg00122.html
      As I’m the main person who’s made changes in this area since
      dmpstruct.h was introduced, I’m the most motivated to clean up
      the situation.
      * make-dist (possibly_non_vc_files): Remove src/dmpstruct.h.
      * src/Makefile.in (dmpstruct_headers, dmpstruct.h): Remove.
      (pdumper.o): Do not depend on dmpstruct.h.
      (mostlyclean): Do not remove dmpstruct.h.
      * src/dmpstruct.awk: Remove.
      * src/pdumper.c: Do not include dmpstruct.h.
      (CHECK_STRUCTS): Remove.  All uses removed.
      44a39e3e
  10. 08 Apr, 2019 1 commit
  11. 03 Apr, 2019 2 commits
    • Eli Zaretskii's avatar
      Improve commentary in 'field_relpos' · 2bcf0f09
      Eli Zaretskii authored
      * src/pdumper.c (PDUMPER_MAX_OBJECT_SIZE): New macro.
      (field_relpos): Use PDUMPER_MAX_OBJECT_SIZE, and comment on
      why we require that relpos be not too large.
      2bcf0f09
    • Eli Zaretskii's avatar
      Restore process-environment after portable dumping · b29b79ef
      Eli Zaretskii authored
      * src/pdumper.c (struct dump_context): New member
      old_process_environment.
      (Fdump_emacs_portable): Record the original value of
      process-environment.
      (dump_unwind_cleanup): Restore the original values of
      process-environment and post-gc-hook.
      b29b79ef
  12. 01 Apr, 2019 1 commit
    • Paul Eggert's avatar
      Fix union Lisp_Fwd * alignment bug · 9287813d
      Paul Eggert authored
      It's not portable to cast (e.g.) struct Lisp_Objfwd * to union
      Lisp_Fwd * and then back again, because the compiler can then assume
      that the pointer is aligned for union Lisp_Fwd * when accessing
      the struct Lisp_Objfwd * components, and this assumption might
      be incorrect becase we don't force that alignment.
      * src/lisp.h (lispfwd): New type, replacing ...
      (union Lisp_Fwd): ... this type, which was removed.
      All uses changed.
      (SET_SYMBOL_FWD): 2nd arg is now void *, not lispfwd.
      All uses changed (casts no longer needed; they were
      not portable anyway).
      9287813d
  13. 30 Mar, 2019 1 commit
    • Eli Zaretskii's avatar
      Don't run buffer-related hooks in " *code conversion work*" buffers · 9c0fa117
      Eli Zaretskii authored
      Note: portions of this change were mistakenly pushed as part
      of an unrelated commit a35a1f6a.
      
      * src/buffer.c (Fget_buffer_create): Set inhibit_buffer_hooks
      non-zero for temporary buffers created by coding.c.  Don't run
      buffer-list-update-hook for such buffers.
      (Frename_buffer, Fkill_buffer, record_buffer)
      (Fbury_buffer_internal): Don't run hooks for buffers whose
      inhibit_buffer_hooks flag is set.
      * src/buffer.h (struct buffer): New member
      inhibit_buffer_hooks.
      * src/pdumper.c (dump_buffer): Dump the new field.  Update the
      hash value in HASH_buffer_XXX.
      * src/coding.c (make_conversion_work_buffer): Function deleted;
      code moved to code_conversion_save.
      (code_conversion_save): Insert code from
      make_conversion_work_buffer, but arrange for unwind-protecting
      the current buffer before switching to the work buffer.  This
      avoids leaving reused_workbuf_in_use set if user presses C-g
      during encoding/decoding.
      (Vcode_conversion_workbuf_name): Now external variable.
      * src/coding.h (Vcode_conversion_reused_workbuf): Declare.
      9c0fa117
  14. 27 Mar, 2019 1 commit
  15. 21 Mar, 2019 1 commit
  16. 19 Mar, 2019 1 commit
    • Paul Eggert's avatar
      Use ‘const’ to clarify GC marking · 53914a10
      Paul Eggert authored
      Add ‘const’ to make the GC marking code a bit clearer.
      This can also help the compiler in some cases, I think because
      GCC can now determine more often that the value of a static C
      variable can be cached when its address is now converted to
      ‘Lisp Object const *’ before escaping.
      * src/alloc.c (staticvec, mark_maybe_objects, mark_memory)
      (mark_stack, staticpro, mark_object_root_visitor)
      (garbage_collect_1):
      * src/pdumper.c (dump_ptr_referrer, dump_emacs_reloc_to_lv)
      (dump_emacs_reloc_to_emacs_ptr_raw, dump_root_visitor):
      * src/lisp.h (vcopy, struct gc_root_visitor):
      * src/sysdep.c (stack_overflow):
      * src/thread.c (mark_one_thread):
      * src/thread.h (struct thread_state):
      Use pointer-to-const instead of plain pointer in some
      GC-related places where either will do.
      53914a10
  17. 17 Mar, 2019 1 commit
    • Eli Zaretskii's avatar
      Fix 'define-charset' after dumping with pdumper · 03a9a75c
      Eli Zaretskii authored
      * src/charset.h:
      * src/charset.c (charset_table_used): Now static.
      (charset_table_size): Now extern.
      * src/pdumper.c (dump_charset_table): Dump the entire
      charset_table, not just its used slots.  (Bug#34826)
      03a9a75c
  18. 11 Mar, 2019 2 commits
  19. 04 Mar, 2019 1 commit
    • Paul Eggert's avatar
      Simplify list creation in C code · 5c2563a5
      Paul Eggert authored
      The main new thing here is that C code can now say
      ‘list (a, b, c, d, e, f)’ instead of
      ‘listn (CONSTYPE_HEAP, 6, a, b, c, d, e, f)’,
      thus relieving callers of the responsibility of counting
      arguments (plus, the code feels more like Lisp).  The old
      list1 ... list5 functions remain, as they’re probably a bit
      faster for small lists.
      * src/alloc.c (cons_listn, pure_listn): New functions.
      (listn): Omit enum argument.
      All callers changed to use either new ‘list’ or ‘pure_list’ macros.
      * src/charset.c (Fdefine_charset_internal):
      * src/coding.c (detect_coding_system)
      (Fset_terminal_coding_system_internal):
      * src/frame.c (frame_size_history_add, adjust_frame_size):
      * src/gtkutil.c (xg_frame_set_char_size):
      * src/keyboard.c (command_loop_1):
      * src/nsfns.m (frame_geometry):
      * src/widget.c (set_frame_size):
      * src/xfaces.c (Fcolor_distance):
      * src/xfns.c (frame_geometry):
      * src/xterm.c (x_set_window_size_1):
      * src/xwidget.c (Fxwidget_size_request):
      Prefer list1i, list2i, etc. to open-coding them.
      * src/charset.c (Fset_charset_priority):
      * src/nsterm.m (append2):
      * src/window.c (window_list):
      * src/xfaces.c (Fx_list_fonts):
      Use nconc2 instead of open-coding it.
      * src/eval.c (eval_sub, backtrace_frame_apply):
      * src/kqueue.c (kqueue_generate_event):
      * src/nsterm.m (performDragOperation:):
      * src/pdumper.c (Fpdumper_stats):
      * src/w32.c (init_environment):
      Prefer list1, list2, etc. to open-coding them.
      * src/font.c (font_list_entities):
      Parenthesize to avoid expanding new ‘list’ macro.
      * src/gtkutil.c (GETSETUP): Rename from MAKE_FLOAT_PAGE_SETUP
      to get lines to fit.  Move outside the ‘list’ call, since it’s
      now a macro.
      * src/keymap.c (Fmake_keymap): Simplify.
      * src/lisp.h (list, pure_list): New macros.
      (list1i): New function.
      5c2563a5
  20. 01 Mar, 2019 3 commits
    • Alan Mackenzie's avatar
      Maintain interval ->position fields correctly in update_interval · 31182c1d
      Alan Mackenzie authored
      Also fix some anomalies in the handling of byte positions in regexp-emacs.c
      This fixes bug #34525.
      
      * src/intervals.c (SET_PARENT_POSITION): New macro.
      (update_interval): When moving to an interval's parent, set that parent's
      ->position field, to maintain the consistency of the tree.
      
      * src/intervals.h (struct interval): Amend the comment describing when
      ->position is valid.
      
      * src/pdumper.c: Update the hash associated with struct interval.
      
      * src/regex-emacs.c: (re_match_2_internal): Only invoke POINTER_TO_OFFSET on a
      known character boundary.  Only perform arithmetic on character positions, not
      on byte positions.  Correct the argument to an invocation of
      UPDATE_SYNTAX_TABLE_FORWARD by adding 1 to it (in case wordend:).
      
      * src/syntax.c: (update_syntax_table): Remove the now redundant code that set
      the ->position field of all parents of the interval found by update_interval.
      31182c1d
    • Paul Eggert's avatar
      Suppress GC stats when obviously not needed · 7e29eae0
      Paul Eggert authored
      This should help future improvements where these stats can be
      bignums that do not fit into intmax_t.
      * src/alloc.c (struct gcstat, gcstat): New type and static var,
      to package up GC statistics into one C object.  It replaces ...
      (total_free_intervals, total_intervals, total_strings)
      (total_free_strings, total_string_bytes, total_vectors)
      (total_vector_slots, total_free_vector_slots): ... these
      removed static vars.  All uses changed.
      (garbage_collect_1): Accept a struct gcstat *, not a void *
      which was not used anymore anyway.  Return a bool indicating
      success, instead of a Lisp object.  All callers changed.
      (garbage_collect): New function.  All C callers of
      Fgarbage_collect changed to use it, since none of them use the
      return value.  Now, only Lisp code uses Fgarbage_collect.
      (Fgarbage_collect): No longer noinline.  Cons up the return
      value here, not in garbage_collect_1.
      7e29eae0
    • Alan Mackenzie's avatar
  21. 27 Feb, 2019 1 commit
    • Paul Eggert's avatar
      DEFVAR_INT variables are now intmax_t · e828765d
      Paul Eggert authored
      Formerly they were fixnums, which led to problems when dealing
      with values that might not fit on 32-bit platforms, such as
      string-chars-consed or floats_consed.  64-bit counters should
      be good enough for these (for a while, anyway...).
      While we’re at it, fix some unlikely integer overflow bugs
      that have been in the code for a while.
      * lib-src/make-docfile.c (write_globals):
      * src/data.c (do_symval_forwarding, store_symval_forwarding):
      * src/eval.c (restore_stack_limits, call_debugger):
      * src/frame.h (struct frame.cost_calculation_baud_rate):
      * src/keyboard.c (last_auto_save, bind_polling_period, read_char):
      * src/lisp.h (struct Lisp_Intfwd.intvar):
      * src/lread.c (defvar_int):
      * src/pdumper.c (dump_fwd_int):
      * src/thread.h (struct thread_state.m_lisp_eval_depth):
      * src/undo.c (truncate_undo_list):
      * src/xselect.c (wait_for_property_change)
      (x_get_foreign_selection):
      * src/xterm.c (x_emacs_to_x_modifiers):
      DEFVAR_INT variables now have the C type intmax_t, not EMACS_INT.
      * src/data.c (store_symval_forwarding):
      * src/gnutls.c (Fgnutls_boot):
      * src/keyboard.c (bind_polling_period):
      * src/macros.c (pop_kbd_macro, Fexecute_kbd_macro):
      * src/undo.c (truncate_undo_list):
      Allow any integer that fits into intmax_t, instead of
      requiring it to be a Lisp fixnum.
      * src/dispnew.c (update_window):
      * src/frame.c (x_figure_window_size):
      * src/gnutls.c (init_gnutls_functions)
      (emacs_gnutls_handle_error):
      * src/keyboard.c (make_lisp_event):
      * src/nsterm.m (ns_dumpglyphs_image):
      * src/profiler.c (make_log):
      * src/scroll.c (calculate_scrolling)
      (calculate_direct_scrolling):
      * src/termcap.c (tputs):
      * src/xterm.c (x_draw_image_relief):
      Avoid implementation-defined behavior on conversion of
      out-of-range integers.
      * src/eval.c (when_entered_debugger): Now intmax_t.
      (max_ensure_room): New function, that avoids signed integer overflow.
      (call_debugger, signal_or_quit): Use it.
      * src/fileio.c (Fdo_auto_save):
      * src/keyboard.c (make_lisp_event):
      * src/term.c (calculate_costs):
      * src/xdisp.c (build_desired_tool_bar_string)
      (hscroll_window_tree, try_scrolling, decode_mode_spec)
      (x_produce_glyphs):
      Avoid signed integer overflow.
      * src/lisp.h (clip_to_bounds): Generalize to intmax_t.
      * src/pdumper.c (dump_emacs_reloc_immediate_emacs_int): Remove, ...
      (dump_emacs_reloc_immediate_intmax_t): ... replacing with this
      function.  All uses changed.
      * src/profiler.c (make_log): Omit args.  All callers changed.
      * src/termcap.c: Include stdlib.h, for atoi.
      Include intprops.h.
      * src/window.c (sanitize_next_screen_context_lines): New function.
      (window_scroll_pixel_based, window_scroll_line_based):
      Use it to avoid signed integer overflow.
      e828765d
  22. 31 Jan, 2019 3 commits
    • Paul Eggert's avatar
      Prefer static to extern where either will do · 47679e63
      Paul Eggert authored
      * src/charset.c (charset_table_size):
      * src/pdumper.c (dump_private):
      * src/sysdep.c (init_sigsegv):
      * src/window.c (old_selected_window):
      Now static.
      * src/charset.c (charset_table_size):
      Now int, since the value always fits in int.
      * src/gtkutil.c (xg_gtk_initialized): Now present only if
      HAVE_XWIDGETS, to make it clearer that this is an xwidgets
      hack.  All uses changed.
      * src/lread.c (ndefsubr): Remove; unused.
      * src/pdumper.h: Use usual GNU indenting style for functions,
      since my static-vs-extern checking hack relies on it.
      (dump_public): Always declare; simpler and doesn’t hurt.
      (pdumper_handle_page_fault): Remove unused decl.
      47679e63
    • Paul Eggert's avatar
      Widen modiff counts to avoid wraparound · 05d2fc71
      Paul Eggert authored
      Widen modification counts to at least 64 bits, to make
      wraparound practically impossible.
      * doc/lispref/buffers.texi (Buffer Modification):
      Don’t say the modification-count can wrap around.
      * src/buffer.c (Frestore_buffer_modified_p, Fbuffer_swap_text)
      (modify_overlay):
      * src/insdel.c (insert_1_both, insert_from_string_1)
      (insert_from_gap, insert_from_buffer_1)
      (adjust_after_replace, replace_range, replace_range_2)
      (del_range_2, modify_text):
      * src/textprop.c (modify_text_properties):
      Use modiff_incr instead of incrementing	directly.
      (Fbuffer_modified_tick, Fbuffer_chars_modified_tick):
      Don’t assume modification counts fit into fixnums.
      * src/buffer.h (struct buffer_text, struct buffer):
      * src/cmds.c (internal_self_insert):
      * src/fileio.c (Finsert_file_contents):
      * src/indent.c (last_known_column_modified):
      * src/keyboard.c (command_loop_1):
      * src/marker.c (cached_modiff):
      * src/syntax.c (find_start_modiff, parse_sexp_propertize)
      (find_defun_start):
      * src/window.h (struct window):
      Use modiff_count for modification counts.
      * src/editfns.c (Fsubst_char_in_region):
      Copy instead of incrementing modification counts,
      since integer overflow checking is not needed here.
      * src/lisp.h (modiff_count): New type.
      (modiff_incr, modiff_to_integer): New inline functions.
      * src/pdumper.c (dump_buffer): Update hash.
      05d2fc71
    • Paul Eggert's avatar
      Minor pdumper simplification · a68eee50
      Paul Eggert authored
      * src/pdumper.c (dump_roots, pdumper_load): Simplify initialization.
      (dump_bitset_init, pdumper_load): Omit unnecessary assignments.
      (dump_bitset_destroy): Remove; never called.  All callers removed.
      (dump_do_dump_relocation, pdumper_load): Add FIXME comment.
      (pdumper_load): Simplify by assuming C99.  Remove unused local.
      a68eee50
  23. 26 Jan, 2019 1 commit
    • Eli Zaretskii's avatar
      Improve pdump file search and 'pdumper-stats' · a7974933
      Eli Zaretskii authored
      * src/pdumper.c (pdumper_record_wd): New function.
      (pdumper_load): Use xstrdup instead of strdup, as on
      MS-Windows the latter uses the wrong heap.  Don't free a
      NULL pointer.
      * src/emacs.c (load_pdump): Support the use case where the
      Emacs binary was renamed: look in exec-directory for the
      pdump file whose base name is derived from the Emacs binary,
      in addition to just emacs.pdmp.
      (main): Call pdumper_record_wd to prepend CWD to the pdump
      file name.
      * src/fileio.c (file_name_absolute_p): Now extern.
      * src/lisp.h (file_name_absolute_p): Add prototype.
      * src/pdumper.h (pdumper_record_wd): Add prototype.
      
      * doc/emacs/cmdargs.texi (Initial Options): Update the
      documentation of where Emacs looks for the dump file.
      a7974933
  24. 23 Jan, 2019 1 commit
  25. 21 Jan, 2019 2 commits
  26. 19 Jan, 2019 4 commits
    • Paul Eggert's avatar
      pdumper-stats now returns s, not ms · 3e125517
      Paul Eggert authored
      * doc/lispref/internals.texi (pdumper-stats):
      * src/pdumper.c (pdumper_load): Return seconds, not milliseconds.
      Minimize rounding errors in the usual case.
      3e125517
    • Eli Zaretskii's avatar
      ; Fix a recent change in pdumper.c · b821a70c
      Eli Zaretskii authored
      * src/pdumper.c (Fpdumper_stats): Don't expand dump filename, as we don't
      record the directory relative to which it was specified.
      b821a70c
    • Eli Zaretskii's avatar
      Minor cleanup in pdumper.c · 8e2b2a2b
      Eli Zaretskii authored
      * src/pdumper (subtract_timespec): Function removed.
      (pdumper_load): Use timespec_sub instead of subtract_timespec.
      8e2b2a2b
    • Eli Zaretskii's avatar
      Improve 'pdumper-stats' and its documentation · 8bb5939e
      Eli Zaretskii authored
      * src/pdumper.c (Fpdumper_stats): Improve formatting and
      wording of the doc string.  Decode the pdump file name and
      expand-file-name it.
      
      * doc/lispref/internals.texi (Building Emacs): Document
      'pdumper-stats'.
      8bb5939e