1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00
emacs/doc
Mattias Engdegård 308e3ab1db Disallow string data resizing (bug#79784)
Only allow string mutation that is certain not to require string data to
be resized and reallocated: writing bytes into a unibyte string, and
changing ASCII to ASCII in a multibyte string.

This ensures that mutation will never transform a unibyte string to
multibyte, that the size of a string in bytes never changes, and that
the byte offsets of characters remain the same.  Most importantly, it
removes a long-standing obstacle to reform of string representation and
allow for future performance improvements.

* src/data.c (Faset): Disallow resizing string mutation.
* src/fns.c (clear_string_char_byte_cache):
* src/alloc.c (resize_string_data):  Remove.
* test/src/data-tests.el (data-aset-string): New test.
* test/lisp/subr-tests.el (subr--subst-char-in-string):
Skip error cases.
* test/src/alloc-tests.el (aset-nbytes-change):
Remove test that is no longer relevant.
* doc/lispref/strings.texi (Modifying Strings):
* doc/lispref/sequences.texi (Array Functions):
* doc/lispref/text.texi (Substitution):  Update manual.
* etc/NEWS: Announce.
2025-08-24 10:28:27 +02:00
..
emacs Improve and clarify documentation of 'dired-click-to-select-mode' 2025-08-23 16:33:45 +03:00
lispintro ; Fix file name in "Loading Files" doc. 2025-07-24 22:13:47 -07:00
lispref Disallow string data resizing (bug#79784) 2025-08-24 10:28:27 +02:00
man Remove ctags program 2025-03-22 11:57:29 -07:00
misc flymake: stop trying to automatically fall back to margins 2025-08-23 14:44:35 +03:00
translations Update copyright year to 2025 2025-01-02 18:39:42 +01:00