<feed xmlns='http://www.w3.org/2005/Atom'>
<title>emacs/src/character.c, branch scratch/bulk-tracing</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>Simplify str_to_multibyte and related code</title>
<updated>2022-07-11T11:52:01+00:00</updated>
<author>
<name>Mattias Engdegård</name>
</author>
<published>2022-07-11T11:43:34+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=5990da629074b09212d7dea31811d0429e3e2fb8'/>
<id>5990da629074b09212d7dea31811d0429e3e2fb8</id>
<content type='text'>
* src/character.h (str_to_multibyte):
* src/character.c (str_to_multibyte): Remove `nbytes` argument; return
it instead.  Copy forwards.
* src/fns.c (concat_to_string, Fstring_make_multibyte):
Use str_to_multibyte.
(string_make_multibyte): Remove.
(string_to_multibyte):
* src/print.c (print_string):  Adapt calls.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/character.h (str_to_multibyte):
* src/character.c (str_to_multibyte): Remove `nbytes` argument; return
it instead.  Copy forwards.
* src/fns.c (concat_to_string, Fstring_make_multibyte):
Use str_to_multibyte.
(string_make_multibyte): Remove.
(string_to_multibyte):
* src/print.c (print_string):  Adapt calls.
</pre>
</div>
</content>
</entry>
<entry>
<title>Simplify and speed up string-to-multibyte</title>
<updated>2022-07-11T08:38:49+00:00</updated>
<author>
<name>Mattias Engdegård</name>
</author>
<published>2022-07-11T08:34:40+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=69b68099ecfb053ac77e0a954ab7467c440321ff'/>
<id>69b68099ecfb053ac77e0a954ab7467c440321ff</id>
<content type='text'>
* src/character.h (str_to_multibyte):
* src/character.c (str_to_multibyte): Change signature and simplify;
the conversion is no longer done in-place.
* src/fns.c (string_to_multibyte): Drop temporary buffer and memcpy;
adapt to new str_to_multibyte signature.
* src/print.c (print_string): Drop memcpy; adapt call to str_to_multibyte.
* test/src/fns-tests.el (fns--string-to-unibyte): Rename to...
(fns--string-to-unibyte-multibyte): ... this and strengthen, so that
the test covers string-to-multibyte reasonably well.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/character.h (str_to_multibyte):
* src/character.c (str_to_multibyte): Change signature and simplify;
the conversion is no longer done in-place.
* src/fns.c (string_to_multibyte): Drop temporary buffer and memcpy;
adapt to new str_to_multibyte signature.
* src/print.c (print_string): Drop memcpy; adapt call to str_to_multibyte.
* test/src/fns-tests.el (fns--string-to-unibyte): Rename to...
(fns--string-to-unibyte-multibyte): ... this and strengthen, so that
the test covers string-to-multibyte reasonably well.
</pre>
</div>
</content>
</entry>
<entry>
<title>Speed up string-to-unibyte</title>
<updated>2022-07-10T16:20:37+00:00</updated>
<author>
<name>Mattias Engdegård</name>
</author>
<published>2022-07-10T16:02:08+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=cfda663282b788972c344e6733a8aa60a3e0f545'/>
<id>cfda663282b788972c344e6733a8aa60a3e0f545</id>
<content type='text'>
* src/character.h (str_to_unibyte):
* src/character.c (str_to_unibyte): Remove.
* src/fns.c (Fstring_to_unibyte): Ditch the call to str_to_unibyte and
the unnecessary heap allocation.  Write new, faster code.
* test/src/fns-tests.el (fns--string-to-unibyte): New test.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/character.h (str_to_unibyte):
* src/character.c (str_to_unibyte): Remove.
* src/fns.c (Fstring_to_unibyte): Ditch the call to str_to_unibyte and
the unnecessary heap allocation.  Write new, faster code.
* test/src/fns-tests.el (fns--string-to-unibyte): New test.
</pre>
</div>
</content>
</entry>
<entry>
<title>Speed up count_size_as_multibyte</title>
<updated>2022-02-16T11:33:35+00:00</updated>
<author>
<name>Mattias Engdegård</name>
</author>
<published>2022-02-16T11:27:59+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=3b7d55a8013914b6707211d148a6e878ca118ad9'/>
<id>3b7d55a8013914b6707211d148a6e878ca118ad9</id>
<content type='text'>
This function is used in many places to calculate the length of
a unibyte string converted to multibyte.

* src/character.c (count_size_as_multibyte): Move the overflow test
outside the loop, which makes it much faster.  Standard compilers
will even vectorise it if asked to (-O2 in Clang, -O3 in GCC).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This function is used in many places to calculate the length of
a unibyte string converted to multibyte.

* src/character.c (count_size_as_multibyte): Move the overflow test
outside the loop, which makes it much faster.  Standard compilers
will even vectorise it if asked to (-O2 in Clang, -O3 in GCC).
</pre>
</div>
</content>
</entry>
<entry>
<title>; Add 2022 to copyright years.</title>
<updated>2022-01-01T07:45:51+00:00</updated>
<author>
<name>Eli Zaretskii</name>
</author>
<published>2022-01-01T07:45:51+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=19dcb237b5b02b36580294ab309124f346a66024'/>
<id>19dcb237b5b02b36580294ab309124f346a66024</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix slow operation of 'string-width'</title>
<updated>2021-06-05T11:16:06+00:00</updated>
<author>
<name>Eli Zaretskii</name>
</author>
<published>2021-06-05T11:16:06+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=f93f3b80dde20a0c643b011d1bf78e34860870a2'/>
<id>f93f3b80dde20a0c643b011d1bf78e34860870a2</id>
<content type='text'>
* src/composite.c (find_automatic_composition): Accept one
additional argument BACKLIM; don't look back in buffer or string
farther than that.  Add an assertion for BACKLIM.
(composition_adjust_point, Ffind_composition_internal): Callers
adjusted.
* src/composite.h (find_automatic_composition): Adjust prototype.
* src/character.c (lisp_string_width): Call
'find_automatic_composition' with the value of BACKLIM equal to POS,
to avoid costly and unnecessary search back in the string, since
those previous characters were already checked for automatic
compositions.  (Bug#48734)  (Bug#48839)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/composite.c (find_automatic_composition): Accept one
additional argument BACKLIM; don't look back in buffer or string
farther than that.  Add an assertion for BACKLIM.
(composition_adjust_point, Ffind_composition_internal): Callers
adjusted.
* src/composite.h (find_automatic_composition): Adjust prototype.
* src/character.c (lisp_string_width): Call
'find_automatic_composition' with the value of BACKLIM equal to POS,
to avoid costly and unnecessary search back in the string, since
those previous characters were already checked for automatic
compositions.  (Bug#48734)  (Bug#48839)
</pre>
</div>
</content>
</entry>
<entry>
<title>Don't account for character compositions in 'format' and friends</title>
<updated>2021-05-30T08:16:59+00:00</updated>
<author>
<name>Eli Zaretskii</name>
</author>
<published>2021-05-30T08:16:59+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=23ad0f0c5adbeda9a0bd346138e2950cb5e5a136'/>
<id>23ad0f0c5adbeda9a0bd346138e2950cb5e5a136</id>
<content type='text'>
'lisp_string_width' is called from 'format' and 'format-message',
which can be called both very early into Emacs initialization and in
other contexts where using the font backend is impossible or
undesirable.  So this commit changes 'lisp_string_width' to try
accounting for automatic compositions only when explicitly requested,
and only 'string-width' does that; 'format' and 'format-message'
don't.
* src/character.c (lisp_string_width): Accept an additional
argument AUTO_COMP; attempt accounting for auto-compositions only
if that argument is non-zero.  (Bug#48732)
* src/editfns.c (styled_format):
* src/character.c (Fstring_width): Callers of 'lisp_string_width'
adjusted.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
'lisp_string_width' is called from 'format' and 'format-message',
which can be called both very early into Emacs initialization and in
other contexts where using the font backend is impossible or
undesirable.  So this commit changes 'lisp_string_width' to try
accounting for automatic compositions only when explicitly requested,
and only 'string-width' does that; 'format' and 'format-message'
don't.
* src/character.c (lisp_string_width): Accept an additional
argument AUTO_COMP; attempt accounting for auto-compositions only
if that argument is non-zero.  (Bug#48732)
* src/editfns.c (styled_format):
* src/character.c (Fstring_width): Callers of 'lisp_string_width'
adjusted.
</pre>
</div>
</content>
</entry>
<entry>
<title>Another stability fix in 'lisp_string_width'</title>
<updated>2021-05-28T11:03:16+00:00</updated>
<author>
<name>Eli Zaretskii</name>
</author>
<published>2021-05-28T11:03:16+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=6d916bfb37d88a63663ad5777c8c3b83fbcfdbd0'/>
<id>6d916bfb37d88a63663ad5777c8c3b83fbcfdbd0</id>
<content type='text'>
* src/character.c (lisp_string_width): Compute C pointer to data
of STRING immediately before using it, since STRING could be
relocated by GC triggered by processing compositions.  (Bug#48711)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/character.c (lisp_string_width): Compute C pointer to data
of STRING immediately before using it, since STRING could be
relocated by GC triggered by processing compositions.  (Bug#48711)
</pre>
</div>
</content>
</entry>
<entry>
<title>Attempt to fix segfaults caused by changes in 'lisp_string_width'</title>
<updated>2021-05-28T07:25:26+00:00</updated>
<author>
<name>Eli Zaretskii</name>
</author>
<published>2021-05-28T07:25:26+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=3fe2f482bd2c636934cfd8e8aa0a07631164831d'/>
<id>3fe2f482bd2c636934cfd8e8aa0a07631164831d</id>
<content type='text'>
* src/character.c (lisp_string_width): Validate the value of TO
argument before passing it to 'composition_gstring_width'.
(Bug#48711)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/character.c (lisp_string_width): Validate the value of TO
argument before passing it to 'composition_gstring_width'.
(Bug#48711)
</pre>
</div>
</content>
</entry>
<entry>
<title>; * src/character.c (lisp_string_width): Another defensive fix.</title>
<updated>2021-05-27T14:15:53+00:00</updated>
<author>
<name>Eli Zaretskii</name>
</author>
<published>2021-05-27T14:15:53+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=f1c3b82d401eecd1facbe0a6c07ccde100ad65d8'/>
<id>f1c3b82d401eecd1facbe0a6c07ccde100ad65d8</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
