aboutsummaryrefslogtreecommitdiffstats
path: root/src/fileio.c
diff options
context:
space:
mode:
authorDmitry Antipov2014-09-15 18:53:23 +0400
committerDmitry Antipov2014-09-15 18:53:23 +0400
commitedb0288b83b45d295df52ce7644e897613358971 (patch)
tree8f169c257e9752ca860764cc19ec232d287eb189 /src/fileio.c
parent497daa12743ed71a70e41f966631d1c8856248cc (diff)
downloademacs-edb0288b83b45d295df52ce7644e897613358971.tar.gz
emacs-edb0288b83b45d295df52ce7644e897613358971.zip
If USE_LOCAL_ALLOCATORS, allocate some Lisp objects on stack.
* lisp.h (local_cons, local_list1, local_list2, local_list3) [USE_LOCAL_ALLOCATORS]: New macros. [!USE_LOCAL_ALLOCATORS]: Fall back to regular functions. (build_local_string): Avoid argument name expansion clash with make_local_string. * alloc.c (toplevel) [USE_LOCAL_ALLOCATORS && GC_MARK_STACK != GC_MAKE_GCPROS_NOOPS]: Preprocessor guard to avoid impossible configuration. * charset.c (Ffind_charset_region, Ffind_charset_string): Use make_local_vector. * lread.c (read1, substitute_object_recurse): Use scoped_cons. * textprop.c (Fput_text_property, Fadd_face_text_property): Use scoped_list2. (copy_text_properties): Use local_cons and local_list3. * chartab.c (uniprop_table): * data.c (wrong_choice, wrong_range): * doc.c (get_doc_string): * editfns.c (format2): * fileio.c (Fexpand_file_name, auto_save_error): * fns.c (Fyes_or_no_p): * font.c (font_parse_xlfd, font_parse_family_registry, font_add_log): * fontset.c (Fset_fontset_font): * keyboard.c (echo_add_key, echo_dash, parse_menu_item) (read_char_minibuf_menu_prompt): * keymap.c (silly_event_symbol_error, describe_vector): * menu.c (single_menu_item): * minibuf.c (Fread_buffer): * process.c (status_message, Fformat_network_address) (server_accept_connection): Use make_local_string and build_local_string. Prefer compound literals where appropriate.
Diffstat (limited to 'src/fileio.c')
-rw-r--r--src/fileio.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/fileio.c b/src/fileio.c
index 0626bd3653a..0b508eae197 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -1162,11 +1162,11 @@ filesystem tree, not (expand-file-name ".." dirname). */)
1162 char newdir_utf8[MAX_UTF8_PATH]; 1162 char newdir_utf8[MAX_UTF8_PATH];
1163 1163
1164 filename_from_ansi (newdir, newdir_utf8); 1164 filename_from_ansi (newdir, newdir_utf8);
1165 tem = build_string (newdir_utf8); 1165 tem = build_local_string (newdir_utf8);
1166 } 1166 }
1167 else 1167 else
1168#endif 1168#endif
1169 tem = build_string (newdir); 1169 tem = build_local_string (newdir);
1170 newdirlim = newdir + SBYTES (tem); 1170 newdirlim = newdir + SBYTES (tem);
1171 if (multibyte && !STRING_MULTIBYTE (tem)) 1171 if (multibyte && !STRING_MULTIBYTE (tem))
1172 { 1172 {
@@ -1198,7 +1198,7 @@ filesystem tree, not (expand-file-name ".." dirname). */)
1198 /* `getpwnam' may return a unibyte string, which will 1198 /* `getpwnam' may return a unibyte string, which will
1199 bite us since we expect the directory to be 1199 bite us since we expect the directory to be
1200 multibyte. */ 1200 multibyte. */
1201 tem = build_string (newdir); 1201 tem = build_local_string (newdir);
1202 newdirlim = newdir + SBYTES (tem); 1202 newdirlim = newdir + SBYTES (tem);
1203 if (multibyte && !STRING_MULTIBYTE (tem)) 1203 if (multibyte && !STRING_MULTIBYTE (tem))
1204 { 1204 {
@@ -1231,7 +1231,7 @@ filesystem tree, not (expand-file-name ".." dirname). */)
1231 adir = NULL; 1231 adir = NULL;
1232 else if (multibyte) 1232 else if (multibyte)
1233 { 1233 {
1234 Lisp_Object tem = build_string (adir); 1234 Lisp_Object tem = build_local_string (adir);
1235 1235
1236 tem = DECODE_FILE (tem); 1236 tem = DECODE_FILE (tem);
1237 newdirlim = adir + SBYTES (tem); 1237 newdirlim = adir + SBYTES (tem);
@@ -1332,7 +1332,7 @@ filesystem tree, not (expand-file-name ".." dirname). */)
1332 getcwd (adir, adir_size); 1332 getcwd (adir, adir_size);
1333 if (multibyte) 1333 if (multibyte)
1334 { 1334 {
1335 Lisp_Object tem = build_string (adir); 1335 Lisp_Object tem = build_local_string (adir);
1336 1336
1337 tem = DECODE_FILE (tem); 1337 tem = DECODE_FILE (tem);
1338 newdirlim = adir + SBYTES (tem); 1338 newdirlim = adir + SBYTES (tem);
@@ -5408,7 +5408,7 @@ An argument specifies the modification time value to use
5408static Lisp_Object 5408static Lisp_Object
5409auto_save_error (Lisp_Object error_val) 5409auto_save_error (Lisp_Object error_val)
5410{ 5410{
5411 Lisp_Object args[3], msg; 5411 Lisp_Object msg;
5412 int i; 5412 int i;
5413 struct gcpro gcpro1; 5413 struct gcpro gcpro1;
5414 5414
@@ -5416,10 +5416,10 @@ auto_save_error (Lisp_Object error_val)
5416 5416
5417 ring_bell (XFRAME (selected_frame)); 5417 ring_bell (XFRAME (selected_frame));
5418 5418
5419 args[0] = build_string ("Auto-saving %s: %s"); 5419 msg = Fformat (3, ((Lisp_Object [])
5420 args[1] = BVAR (current_buffer, name); 5420 { build_local_string ("Auto-saving %s: %s"),
5421 args[2] = Ferror_message_string (error_val); 5421 BVAR (current_buffer, name),
5422 msg = Fformat (3, args); 5422 Ferror_message_string (error_val) }));
5423 GCPRO1 (msg); 5423 GCPRO1 (msg);
5424 5424
5425 for (i = 0; i < 3; ++i) 5425 for (i = 0; i < 3; ++i)