<feed xmlns='http://www.w3.org/2005/Atom'>
<title>emacs/src/profiler.c, branch scratch/add-lisp-data-mode</title>
<subtitle>Emacs is the extensible, customizable, self-documenting real-time display editor. 
</subtitle>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/'/>
<entry>
<title>Update copyright year to 2020</title>
<updated>2020-01-01T00:59:52+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2020-01-01T00:19:43+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=365e01cc9f64ce6ca947ccfd8612d60763280a37'/>
<id>365e01cc9f64ce6ca947ccfd8612d60763280a37</id>
<content type='text'>
Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
</pre>
</div>
</content>
</entry>
<entry>
<title>* src/profiler.c: Leave `key` hashslots as Qunbound (bug#37382)</title>
<updated>2019-09-12T12:25:36+00:00</updated>
<author>
<name>Stefan Monnier</name>
</author>
<published>2019-09-12T12:25:13+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=997415504c37b4dc1f486b9d9925c4e16ade015c'/>
<id>997415504c37b4dc1f486b9d9925c4e16ade015c</id>
<content type='text'>
Now that "key == Qunbound" is used to determine if a hash table entry
is available, we can't stash pre-allocated vectors into the `key` slot
anymore, so use the `value` slot instead.

(make_log): Pre-fill the `value` slots i.s.o `key`.
(evict_lower_half): Stash key back into `value`, i.s.o `key`.
(record_backtrace): Get pre-allocated vector for `value` i.s.o `key`.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now that "key == Qunbound" is used to determine if a hash table entry
is available, we can't stash pre-allocated vectors into the `key` slot
anymore, so use the `value` slot instead.

(make_log): Pre-fill the `value` slots i.s.o `key`.
(evict_lower_half): Stash key back into `value`, i.s.o `key`.
(record_backtrace): Get pre-allocated vector for `value` i.s.o `key`.
</pre>
</div>
</content>
</entry>
<entry>
<title>Debug out-of-range make_fixnum args</title>
<updated>2019-08-15T09:18:44+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2019-08-15T09:18:06+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=3548fd8a53869ce6b42c47f690660cb8eddb8aab'/>
<id>3548fd8a53869ce6b42c47f690660cb8eddb8aab</id>
<content type='text'>
With --enable-checking, make_fixnum (N) now checks that N is
in fixnum range.  Suggested by Pip Cet in:
https://lists.gnu.org/r/emacs-devel/2019-07/msg00548.html
A new function make_ufixnum (N) is for the rare cases where N
is intended to be unsigned and is in the range 0..INTMASK.
* configure.ac (AC_C_TYPEOF): Add.
(HAVE_STATEMENT_EXPRESSIONS): Resurrect this macro.
* src/fns.c (Frandom, hashfn_eq, hashfn_equal, hashfn_user_defined):
* src/profiler.c (hashfn_profiler):
Use make_ufixnum rather than make_fixum, since the argument is
an unsigned integer in the range 0..INTMASK rather than a signed
integer in the range MOST_NEGATIVE_FIXNUM..MOST_POSITIVE_FIXNUM.
Typically this is for hashes.
* src/lisp.h (lisp_h_make_fixnum_wrap) [USE_LSB_TAG]:
Rename from lisp_h_make_fixnum.
(lisp_h_make_fixnum): Redefine in terms of lisp_h_make_fixnum_wrap.
Check for fixnum overflow on compilers like GCC that
have statement expressions and typeof.
(FIXNUM_OVERFLOW_P): Move up.
(make_fixnum): Check for fixnum overflow.
(make_ufixnum): New function, which checks that the arg
fits into 0..INTMASK range.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With --enable-checking, make_fixnum (N) now checks that N is
in fixnum range.  Suggested by Pip Cet in:
https://lists.gnu.org/r/emacs-devel/2019-07/msg00548.html
A new function make_ufixnum (N) is for the rare cases where N
is intended to be unsigned and is in the range 0..INTMASK.
* configure.ac (AC_C_TYPEOF): Add.
(HAVE_STATEMENT_EXPRESSIONS): Resurrect this macro.
* src/fns.c (Frandom, hashfn_eq, hashfn_equal, hashfn_user_defined):
* src/profiler.c (hashfn_profiler):
Use make_ufixnum rather than make_fixum, since the argument is
an unsigned integer in the range 0..INTMASK rather than a signed
integer in the range MOST_NEGATIVE_FIXNUM..MOST_POSITIVE_FIXNUM.
Typically this is for hashes.
* src/lisp.h (lisp_h_make_fixnum_wrap) [USE_LSB_TAG]:
Rename from lisp_h_make_fixnum.
(lisp_h_make_fixnum): Redefine in terms of lisp_h_make_fixnum_wrap.
Check for fixnum overflow on compilers like GCC that
have statement expressions and typeof.
(FIXNUM_OVERFLOW_P): Move up.
(make_fixnum): Check for fixnum overflow.
(make_ufixnum): New function, which checks that the arg
fits into 0..INTMASK range.
</pre>
</div>
</content>
</entry>
<entry>
<title>Tweak performance of cmpfn_profiler</title>
<updated>2019-07-23T05:09:27+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2019-07-23T05:09:05+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=56a3e4a5d366a8453608d9a604ebd5ddb4e52245'/>
<id>56a3e4a5d366a8453608d9a604ebd5ddb4e52245</id>
<content type='text'>
* src/profiler.c (cmpfn_profiler):
Improve performance when VECTORP (bt1) &amp;&amp; EQ (bt1, bt2).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/profiler.c (cmpfn_profiler):
Improve performance when VECTORP (bt1) &amp;&amp; EQ (bt1, bt2).
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix crash if user test munges hash table</title>
<updated>2019-07-21T03:13:46+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2019-07-21T02:40:03+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=515afc9c15870cd7bd6b96e2d8b89938116923ac'/>
<id>515afc9c15870cd7bd6b96e2d8b89938116923ac</id>
<content type='text'>
* src/fns.c (restore_mutability)
(hash_table_user_defined_call): New functions.
(cmpfn_user_defined, hashfn_user_defined): Use them.
(make_hash_table, copy_hash_table):
Mark new hash table as mutable.
(check_mutable_hash_table): New function.
(Fclrhash, Fputhash, Fremhash): Use it instead of CHECK_IMPURE.
* src/lisp.h (struct hash_table_test): User-defined functions
now take pointers to struct Lisp_Hash_Table, not to struct
hash_table_test.  All uses changed.
(struct Lisp_Hash_Table): New member ‘mutable’.
* src/pdumper.c (dump_hash_table): Copy it.
* test/src/fns-tests.el (test-hash-function-that-mutates-hash-table):
New test, which tests for the bug.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/fns.c (restore_mutability)
(hash_table_user_defined_call): New functions.
(cmpfn_user_defined, hashfn_user_defined): Use them.
(make_hash_table, copy_hash_table):
Mark new hash table as mutable.
(check_mutable_hash_table): New function.
(Fclrhash, Fputhash, Fremhash): Use it instead of CHECK_IMPURE.
* src/lisp.h (struct hash_table_test): User-defined functions
now take pointers to struct Lisp_Hash_Table, not to struct
hash_table_test.  All uses changed.
(struct Lisp_Hash_Table): New member ‘mutable’.
* src/pdumper.c (dump_hash_table): Copy it.
* test/src/fns-tests.el (test-hash-function-that-mutates-hash-table):
New test, which tests for the bug.
</pre>
</div>
</content>
</entry>
<entry>
<title>Simplify hashfn/cmpfn calling convention</title>
<updated>2019-07-21T03:13:46+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2019-07-21T02:40:03+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=b6f194a0fb6dbd1b19aa01f95a955f5b8b23b40e'/>
<id>b6f194a0fb6dbd1b19aa01f95a955f5b8b23b40e</id>
<content type='text'>
* src/fns.c (cmpfn_eql, cmpfn_equal, cmpfn_user_defined)
(hashfn_eq, hashfn_equal, hashfn_eql, hashfn_user_defined):
* src/profiler.c (cmpfn_profiler, hashfn_profiler):
Use new calling convention where the return value is a fixnum
instead of EMACS_UINT.  While we’re at it, put the hash table
at the end, since that’s a bit simpler and generates better
code (at least on the x86-64).  All callers changed.
* src/fns.c (hash_lookup): Store fixnum rather than EMACS_UINT.
All callers changed.
(hash_put): Take a fixnum rather than an EMACS_UINT.
All callers changed.  Remove unnecessary eassert (XUFIXNUM does it).
* src/lisp.h (struct hash_table_test):
Adjust signatures of cmpfn and hashfn.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/fns.c (cmpfn_eql, cmpfn_equal, cmpfn_user_defined)
(hashfn_eq, hashfn_equal, hashfn_eql, hashfn_user_defined):
* src/profiler.c (cmpfn_profiler, hashfn_profiler):
Use new calling convention where the return value is a fixnum
instead of EMACS_UINT.  While we’re at it, put the hash table
at the end, since that’s a bit simpler and generates better
code (at least on the x86-64).  All callers changed.
* src/fns.c (hash_lookup): Store fixnum rather than EMACS_UINT.
All callers changed.
(hash_put): Take a fixnum rather than an EMACS_UINT.
All callers changed.  Remove unnecessary eassert (XUFIXNUM does it).
* src/lisp.h (struct hash_table_test):
Adjust signatures of cmpfn and hashfn.
</pre>
</div>
</content>
</entry>
<entry>
<title>DEFVAR_INT variables are now intmax_t</title>
<updated>2019-02-27T09:23:30+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2019-02-27T09:14:27+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=e828765d01313acddcf17279b6b43ae9f777f2a4'/>
<id>e828765d01313acddcf17279b6b43ae9f777f2a4</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Minor profiler improvements</title>
<updated>2019-02-18T22:43:19+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2019-02-18T22:42:45+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=5d46862440af7957ea617e42d6c1c6ee4c46ba3e'/>
<id>5d46862440af7957ea617e42d6c1c6ee4c46ba3e</id>
<content type='text'>
* src/profiler.c (evict_lower_half, record_backtrace)
(setup_cpu_timer, cmpfn_profiler, hashfn_profiler):
Assume C99.  Use bool for boolean.
(timer_getoverrun): Remove; simplify use to not need it.
(Fprofiler_cpu_start): Any negative return from setup_cpu_timer fails.
(Fprofiler_cpu_stop): Simplify initialization.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/profiler.c (evict_lower_half, record_backtrace)
(setup_cpu_timer, cmpfn_profiler, hashfn_profiler):
Assume C99.  Use bool for boolean.
(timer_getoverrun): Remove; simplify use to not need it.
(Fprofiler_cpu_start): Any negative return from setup_cpu_timer fails.
(Fprofiler_cpu_stop): Simplify initialization.
</pre>
</div>
</content>
</entry>
<entry>
<title>Use 'timer_getoverrun' on Cygwin when possible</title>
<updated>2019-02-18T17:16:06+00:00</updated>
<author>
<name>Ken Brown</name>
</author>
<published>2019-02-17T17:10:26+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=eccfdaff5b52e1fadbaf2fbbb6c1366a7addf377'/>
<id>eccfdaff5b52e1fadbaf2fbbb6c1366a7addf377</id>
<content type='text'>
* configure.ac: Add a check for the 'timer_getoverrun' function.

* src/profiler.c [CYGWIN] : Define 'timer_getoverrun' as a
macro only on versions of Cygwin where it is not already
defined as a function.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* configure.ac: Add a check for the 'timer_getoverrun' function.

* src/profiler.c [CYGWIN] : Define 'timer_getoverrun' as a
macro only on versions of Cygwin where it is not already
defined as a function.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix --enable-profiling builds (bug#34099)</title>
<updated>2019-01-17T12:19:45+00:00</updated>
<author>
<name>Glenn Morris</name>
</author>
<published>2019-01-17T12:19:45+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=8ca414de0eb0b87f4c9a8d301cc45ec51312dace'/>
<id>8ca414de0eb0b87f4c9a8d301cc45ec51312dace</id>
<content type='text'>
* src/profiler.c (syms_of_profiler_for_pdumper):
Only set cpu_log if CPU profiling is enabled.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/profiler.c (syms_of_profiler_for_pdumper):
Only set cpu_log if CPU profiling is enabled.
</pre>
</div>
</content>
</entry>
</feed>
