1. 12 Aug, 2020 1 commit
    • Paul Eggert's avatar
      Don’t warn about integer conversion in pdumper.c · 4491a55a
      Paul Eggert authored
      Problem reported by Juanma Barranquero in:
      https://lists.gnu.org/r/emacs-devel/2020-08/msg00279.html
      and a similar glitch was reported by Eli Zaretskii (Bug#36597#67).
      * src/pdumper.c: Remove -Wconversion pragma.
      (ALLOW_IMPLICIT_CONVERSION, DISALLOW_IMPLICIT_CONVERSION):
      Remove.  All uses removed.  Although -Wconversion may have
      been helpful when writing pdumper.c it is now causing more
      trouble than it’s worth here (just as in the rest of Emacs).
      (dump_read_all): Avoid no-longer-necessary use of ‘size_t’
      rather than ‘int’.
      4491a55a
  2. 11 Aug, 2020 9 commits
    • Philipp Stephani's avatar
      Unbreak build with --enable-checking=all · ccb5556b
      Philipp Stephani authored
      Commit 16a16645 has only changed a
      comment in ‘struct Lisp_Hash_Table’, so the portable dumper doesn’t
      need to be adapted.
      
      * src/pdumper.c (dump_hash_table): Update hash code for ‘struct
      Lisp_Hash_Table’.
      ccb5556b
    • Paul Eggert's avatar
      Prefer make_nil_vector to make-vector with nil · 669aeafb
      Paul Eggert authored
      * src/pdumper.c (hash_table_thaw): Pacify -Wconversion so
      we can use make_nil_vector again.
      * src/timefns.c (syms_of_timefns): Prefer make_nil_vector
      to make_vector with Qnil.
      669aeafb
    • Eli Zaretskii's avatar
      Fix MinGW build broken by recent pdumper changes. · b5b7f6eb
      Eli Zaretskii authored
      * src/pdumper.c (hash_table_thaw): Use Fmake_vector.  Suggested by
      Pip Cet <pipcet@gmail.com>.
      (dump_trace): Declare ATTRIBUTE_FORMAT_PRINTF, not
      ATTRIBUTE_FORMAT((__printf__), so that we pick the right attribute
      for MinGW.
      b5b7f6eb
    • Paul Eggert's avatar
      pdumper avoid listing hash table contents · 25b41688
      Paul Eggert authored
      * src/pdumper.c (hash_table_contents): Create a vector directly,
      instead of creating a list and then converting that to a vector.
      25b41688
    • Paul Eggert's avatar
      pdumper speed tweeks for hash tables · 53132c16
      Paul Eggert authored
      * src/pdumper.c (dump_queue_empty_p): Avoid unnecessary call
      to Fhash_table_count on a known hash table.
      (dump_hash_table_list): !NILP, not CONSP.
      (hash_table_freeze, hash_table_thaw): ASIZE, not Flength, on vectors.
      Initialize in same order as struct.
      (hash_table_thaw): make_nil_vector, not Fmake_vector with nil.
      53132c16
    • Paul Eggert's avatar
      In pdumper, simplify INT_MAX computation · 9e4e4775
      Paul Eggert authored
      * src/pdumper.c (dump_read_all): Avoid unnecessary cast.
      Also, round down to page size, as sysdep.c does.
      Also, don’t assume INT_MAX <= UINT_MAX (!).
      9e4e4775
    • Paul Eggert's avatar
      Don’t needlessly convert to ‘unsigned’ in pdumper · eeaef1ae
      Paul Eggert authored
      * src/pdumper.c (PRIdDUMP_OFF): New macro.
      (EMACS_INT_XDIGITS): New constant.
      (struct dump_context): Use dump_off for relocation counts.
      All uses changed.
      (dump_queue_enqueue, dump_queue_dequeue, Fdump_emacs_portable):
      Don’t assume counts fit in ‘unsigned’ or ‘unsigned long’.
      Use EMACS_INT_XDIGITS instead of assuming it’s 16.
      eeaef1ae
    • Paul Eggert's avatar
    • Pip Cet's avatar
      Rehash hash tables eagerly after loading a dump · 16a16645
      Pip Cet authored
      This simplifies code, and helps performance in some cases (Bug#36597).
      * src/lisp.h (hash_rehash_needed_p): Remove.  All uses removed.
      (hash_rehash_if_needed): Remove.  All uses removed.
      (struct Lisp_Hash_Table): Remove comment about rehashing hash tables.
      * src/pdumper.c (thaw_hash_tables): New function.
      (hash_table_thaw): New function.
      (hash_table_freeze): New function.
      (dump_hash_table): Simplify.
      (dump_hash_table_list): New function.
      (hash_table_contents): New function.
      (Fdump_emacs_portable): Handle hash tables by eager rehashing.
      (pdumper_load): Restore hash tables.
      (init_pdumper_once): New function.
      16a16645
  3. 04 Aug, 2020 1 commit
  4. 30 Jul, 2020 1 commit
    • Paul Eggert's avatar
      Port to Oracle Studio 12.6 (sparc) · 88b4516c
      Paul Eggert authored
      * src/alloc.c (__builtin_unwind_init) [!HAVE___BUILTIN_UNWIND_INIT]:
      Move from here ...
      * src/lisp.h: ... to here, since flush_stack_call_func uses it.
      * src/pdumper.c (dump_off_from_lisp): Avoid ‘return n;;’ to pacify
      Oracle Studio.
      88b4516c
  5. 31 May, 2020 1 commit
  6. 27 May, 2020 1 commit
    • Paul Eggert's avatar
      --with-wide-int is a no-op on 64-bit hosts · 9d11f127
      Paul Eggert authored
      * configure.ac: Clarify wording for --with-wide-int help.
      * src/pdumper.c (dump_vectorlike_generic):
      Do the eassert even if --with-wide-int was specified unnecessarily.
      9d11f127
  7. 01 Apr, 2020 1 commit
  8. 31 Mar, 2020 1 commit
    • Stefan Monnier's avatar
      Remove `all_buffers` and the associated `next` field of buffers · cddf85d2
      Stefan Monnier authored
      * src/alloc.c (enum mem_type): Remove MEM_TYPE_BUFFER.
      (allocate_buffer): Allocate like any other pseudovector.
      Don't register on `all_buffers` any more.
      (live_buffer_holding, live_buffer_p): Delete functions.
      (mark_maybe_object, valid_lisp_object_p): Don't pay attention to
      MEM_TYPE_BUFFER any more.
      (garbage_collect): Only compact the live buffers.
      (mark_buffer): Mark the undo_list of dead buffers here.
      (mark_object): Buffers are normal pseudovectors now.
      (sweep_buffers): Don't do the actual sweep here, just cleanup the
      markers and only for live buffers.
      
      * src/buffer.c (all_buffers): Remove variable.
      (Fkill_buffer): Don't check indirect dead buffers.
      Set the undo_list before we remove ourselves from the list of live buffers.
      (Fbuffer_swap_text, Fset_buffer_multibyte): Don't check indirect dead
      buffers.
      (init_buffer_once): Don't set `all_buffers`.
      (init_buffer): Don't map new memory for dead buffers.
      
      * src/buffer.h (struct buffer): Remove `next` field.
      (FOR_EACH_BUFFER): Remove macro.
      
      * src/pdumper.c (dump_buffer): Don't dump the `next` field.
      cddf85d2
  9. 04 Mar, 2020 1 commit
    • Paul Eggert's avatar
      Pacify GCC 9.2.1 20190927 -O3 · dc3006cf
      Paul Eggert authored
      Original problem report by N. Jackson in:
      https://lists.gnu.org/r/emacs-devel/2020-03/msg00047.html
      I found some other warnings when I used gcc, and fixed them
      with this patch.
      * lib-src/etags.c: Include verify.h.
      (xnmalloc, xnrealloc): Tell the compiler that NITEMS is
      nononnegative and ITEM_SIZE is positive.
      * src/conf_post.h (__has_attribute_returns_nonnull)
      (ATTRIBUTE_RETURNS_NONNULL): New macros.
      * src/editfns.c (Fuser_full_name): Don’t assume Fuser_login_name
      returns non-nil.
      * src/intervals.c (rotate_right, rotate_left, update_interval):
      * src/intervals.h (LENGTH, LEFT_TOTAL_LENGTH, RIGHT_TOTAL_LENGTH):
      Use TOTAL_LENGTH0 or equivalent on intervals that might be null.
      * src/intervals.h (TOTAL_LENGTH): Assume arg is nonnull.
      (TOTAL_LENGTH0): New macro, with the old TOTAL_LENGTH meaning.
      (make_interval, split_interval_right): Add ATTRIBUTE_RETURNS_NONNULL.
      * src/pdumper.c (dump_check_dump_off): Now returns void, since
      no caller uses the return value.  Redo assert to pacify GCC.
      (decode_emacs_reloc): Add a seemingly-random eassume to pacify GCC.
      Ugly, and I suspect due to a bug in GCC.
      dc3006cf
  10. 29 Feb, 2020 1 commit
  11. 12 Jan, 2020 1 commit
  12. 01 Jan, 2020 1 commit
  13. 24 Dec, 2019 2 commits
  14. 23 Dec, 2019 2 commits
  15. 15 Oct, 2019 1 commit
    • Robert Pluim's avatar
      Fix duplicated words in comments · eda38526
      Robert Pluim authored
      * src/coding.c (encode_string_utf_8):
      * src/keyboard.c (syms_of_keyboard):
      * src/mini-gmp.c (gmp_lucas_mod, mpz_export):
      * src/pdumper.c (dump_set_referrer, dump_queue_compute_score):
      * src/timefns.c (Ftime_convert): Remove duplicated words.
      eda38526
  16. 05 Oct, 2019 1 commit
  17. 22 Sep, 2019 1 commit
  18. 11 Sep, 2019 1 commit
    • Paul Eggert's avatar
      Improve checking of pdump load failures · 5fafa40d
      Paul Eggert authored
      * src/alloc.c (memory_full): Just report "memory exhausted" if
      failure occurs during initialization, since fancier recovery
      schemes are not likely to work when not initialized.
      * src/emacs.c (dump_error_to_string): Accept int, not enum
      pdumper_load_result, since the result might not fit in the
      enum.  Use strerror if it was derived from errno.  This is for
      better diagnostics of pdump load failures.
      (load_pdump_find_executable): Return char *, not enum.  2nd
      arg is now pointer to buffer size, rather than pointer to
      pointer to buffer.  All callers changed.  Use Emacs allocator
      since they should now be OK even during early startup.
      Use check_executable instead access, to use effective rather
      than real permissions.
      (load_pdump): Return void since callers ignore result.
      Use int where enum could be too narrow.  Use heap rather
      than stack for possibly-long string.  Prefer ptrdiff_t to
      size_t.
      * src/fileio.c (check_executable): Now extern.
      * src/pdumper.c (pdumper_load): Return int that may have
      errno added to it, for better diagnostics when loads fail.
      5fafa40d
  19. 04 Sep, 2019 3 commits
    • Paul Eggert's avatar
      Port pdumper mmap to AIX · d607067d
      Paul Eggert authored
      * src/pdumper.c (needs_mmap_retry_p) [_AIX]: Return true.
      Problem observed on AIX 7.1 and 7.2 in GCC compile farm.
      d607067d
    • Paul Eggert's avatar
      Avoid macros in pdumper.c when it’s easy · 9117a667
      Paul Eggert authored
      Problem with DUMP_SET_REFERRER mentioned by Pip Cet at end of:
      https://lists.gnu.org/archive/html/emacs-devel/2019-07/msg00548.html
      * src/pdumper.c (DANGEROUS, EMACS_RELOC_TYPE_BITS)
      (EMACS_RELOC_LENGTH_BITS, DUMP_RELOC_TYPE_BITS)
      (DUMP_RELOC_ALIGNMENT_BITS, DUMP_RELOC_OFFSET_BITS)
      (DUMP_RELOCATION_ALIGNMENT, DUMP_ALIGNMENT)
      (WEIGHT_NONE, WEIGHT_NORMAL, WEIGHT_STRONG)
      (PDUMPER_MAX_OBJECT_SIZE):
      Now a constant, not a macro.
      (divide_round_up): Now a function, not a macro DIVIDE_ROUND_UP.
      All uses changed.
      (enum link_weight_enum, WEIGHT_NONE_VALUE)
      (WEIGHT_NORMAL_VALUE, WEIGHT_STRONG_VALUE): Remove.
      (struct link_weight): Just use an int.
      (dump_set_referrer): New function, replacing DUMP_SET_REFERRER
      macro with a different API.  All uses changed.
      (dump_clear_referrer): Rename from DUMP_CLEAR_REFERRER.
      All uses changed.
      (DEFINE_FROMLISP_FUNC, DEFINE_TOLISP_FUNC): Remove.
      (intmax_t_from_lisp, intmax_t_to_lisp, dump_off_from_lisp)
      (dump_off_to_lisp): Define without using macros,
      (dump_off_from_lisp): Add an eassert range check.
      (DUMP_FIELD_COPY): Simplify.
      9117a667
    • Paul Eggert's avatar
      Avoid casting -1 to possibly-unsigned enum · d2065566
      Paul Eggert authored
      * src/alloc.c (mark_maybe_pointer):
      * src/pdumper.h (pdumper_object_p_precise):
      Use pdumper_valid_object_type_p.
      * src/pdumper.c (pdumper_find_object_type_impl):
      * src/pdumper.h (pdumper_find_object_type):
      Return int, not enum Lisp_Type.  All callers changed.
      * src/pdumper.h (PDUMPER_NO_OBJECT): Do not cast -1 to enum
      Lisp_Type; in theory, C18 says this could yield 7, which would
      mean PDUMPER_NO_OBJECT == Lisp_Float (!).
      (pdumper_valid_object_type_p): New function.
      d2065566
  20. 31 Aug, 2019 1 commit
  21. 21 Aug, 2019 1 commit
    • Paul Eggert's avatar
      Be more careful about pointers to bignum vals · 39fee209
      Paul Eggert authored
      This uses ‘const’ to be better at catching bugs that
      mistakenly attempt to modify a bignum value.
      Lisp bignums are supposed to be immutable.
      * src/alloc.c (make_pure_bignum):
      * src/fns.c (sxhash_bignum):
      Accept Lisp_Object instead of struct Lisp_Bignum *, as that’s
      simpler now.  Caller changed.
      * src/bignum.h (bignum_val, xbignum_val): New inline functions.
      Prefer them to &i->value and XBIGNUM (i)->value, since they
      apply ‘const’ to the result.
      * src/timefns.c (lisp_to_timespec): Use mpz_t const *
      to point to a bignum value.
      39fee209
  22. 07 Aug, 2019 1 commit
    • Paul Eggert's avatar
      Re-port dump_bitset_clear to -fsanitize=undefined · 220f16ca
      Paul Eggert authored
      * src/pdumper.c (dump_bitset_clear): Skip the memset if the
      size is zero, because in that case the destination might be NULL.
      This fixes a bug introduced in 2019-07-26T06:17:52Zeggert@cs.ucla.edu.
      Add a comment to make the bug less likely to reoccur.
      220f16ca
  23. 05 Aug, 2019 1 commit
  24. 26 Jul, 2019 4 commits
    • Stefan Monnier's avatar
      Adjust remaining uses of `NILP (HASH_HASH)`. · 0f09808e
      Stefan Monnier authored
      * src/json.c (lisp_to_json_toplevel_1):
      * src/pdumper.c (dump_hash_table_stable_p, hash_table_contents):
      * src/print.c (print, print_vectorlike):
      * src/minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
      Use `EQ (HASH_KEY, Qunbound)` instead of `NILP (HASH_HASH)`.
      0f09808e
    • Stefan Monnier's avatar
      Don't dump the `hash` vector if it will need to be recomputed anyway · 0dc5a85a
      Stefan Monnier authored
      * src/fns.c (hash_table_rehash): Only set `hash` field at the end.
      (sweep_weak_table): Only set slot of `hash` vector when that vector exists.
      (Fhash_table_count): No need to hash_rehash_if_needed any more.
      
      * src/lisp.h (hash_rehash_needed_p): Test the presence of `hash` instead.
      
      * src/pdumper.c (check_hash_table_rehash, dump_hash_table):
      Set `hash` to nil to indicate that the table needs to be rehashed.
      0dc5a85a
    • Stefan Monnier's avatar
      * src/fns.c (hash_index_size): New function, extracted from make_hash_table · bbff294b
      Stefan Monnier authored
      (make_hash_table, maybe_resize_hash_table): Use it.
      
      * src/pdumper.c (check_hash_table_rehash): Use hash_rehash_needed_p.
      bbff294b
    • Paul Eggert's avatar
      Minor pdumper tweaks · 62047917
      Paul Eggert authored
      * src/pdumper.c (dump_hash_table_stable_p):
      Bool vectors and bignums are also stable keys.
      (decode_emacs_reloc, drain_reloc_list, Fdump_emacs_portable):
      (dump_bitset_clear): Simplify use of memset.
      62047917
  25. 23 Jul, 2019 1 commit
    • Paul Eggert's avatar
      Merge pdumper.c and alloc.c builtin symbol tests · a48726eb
      Paul Eggert authored
      * src/alloc.c (c_symbol_p): Move from here ...
      * src/lisp.h (c_symbol_p): ... to here, and make it more portable
      to hypothetical platforms where pointers are wider than ptrdiff_t.
      * src/pdumper.c (dump_builtin_symbol_p): Use c_symbol_p.
      a48726eb