aboutsummaryrefslogtreecommitdiffstats
path: root/src/lisp.h
diff options
context:
space:
mode:
authorYAMAMOTO Mitsuharu2015-12-31 10:59:40 +0900
committerYAMAMOTO Mitsuharu2015-12-31 10:59:40 +0900
commit47580e0d72f53c2fff23cb8edf1487da76e87744 (patch)
treee81c698d019e12a680aed3c0867a7c04d49cc4af /src/lisp.h
parent0588be7ca658faf79bbff7ffcb7eb9f0e3fb8190 (diff)
downloademacs-47580e0d72f53c2fff23cb8edf1487da76e87744.tar.gz
emacs-47580e0d72f53c2fff23cb8edf1487da76e87744.zip
Avoid writing to purespace
* src/alloc.c (Fmake_string): Don't write to empty string contents. (allocate_vector): Don't write to empty vector size. * src/character.h (CHECK_CHARACTER_CAR, CHECK_CHARACTER_CDR): Don't call unnecessary XSETCAR or XSETCDR. * src/lisp.h (STRING_SET_UNIBYTE, STRING_SET_MULTIBYTE): Don't write to empty string size_byte.
Diffstat (limited to 'src/lisp.h')
-rw-r--r--src/lisp.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lisp.h b/src/lisp.h
index 995760a5019..477521bbf4e 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -1325,7 +1325,7 @@ STRING_MULTIBYTE (Lisp_Object str)
1325/* Mark STR as a unibyte string. */ 1325/* Mark STR as a unibyte string. */
1326#define STRING_SET_UNIBYTE(STR) \ 1326#define STRING_SET_UNIBYTE(STR) \
1327 do { \ 1327 do { \
1328 if (EQ (STR, empty_multibyte_string)) \ 1328 if (XSTRING (STR)->size == 0) \
1329 (STR) = empty_unibyte_string; \ 1329 (STR) = empty_unibyte_string; \
1330 else \ 1330 else \
1331 XSTRING (STR)->size_byte = -1; \ 1331 XSTRING (STR)->size_byte = -1; \
@@ -1335,7 +1335,7 @@ STRING_MULTIBYTE (Lisp_Object str)
1335 ASCII characters in advance. */ 1335 ASCII characters in advance. */
1336#define STRING_SET_MULTIBYTE(STR) \ 1336#define STRING_SET_MULTIBYTE(STR) \
1337 do { \ 1337 do { \
1338 if (EQ (STR, empty_unibyte_string)) \ 1338 if (XSTRING (STR)->size == 0) \
1339 (STR) = empty_multibyte_string; \ 1339 (STR) = empty_multibyte_string; \
1340 else \ 1340 else \
1341 XSTRING (STR)->size_byte = XSTRING (STR)->size; \ 1341 XSTRING (STR)->size_byte = XSTRING (STR)->size; \