]> git.eshelyaron.com Git - emacs.git/commitdiff
If USE_LOCAL_ALLOCATORS, allocate even more Lisp objects on stack.
authorDmitry Antipov <dmantipov@yandex.ru>
Tue, 16 Sep 2014 08:20:08 +0000 (12:20 +0400)
committerDmitry Antipov <dmantipov@yandex.ru>
Tue, 16 Sep 2014 08:20:08 +0000 (12:20 +0400)
* charset.c (load_charset_map_from_file): Use scoped_list2
and build_local_string.
* buffer.c (Fother_buffer, other_buffer_safely, init_buffer):
* emacs.c (init_cmdargs, decode_env_path):
* fileio.c (Fexpand_file_name):
* fns.c (maybe_resize_hash_table) [ENABLE_CHECKING]:
* frame.c (x_get_arg):
* keyboard.c (safe_run_hooks_error):
* lread.c (load_warn_old_style_backquotes):
* xdisp.c (Fcurrent_bidi_paragraph_direction):
* xfns.c (x_default_scroll_bar_color_parameter, select_visual):
* xselect.c (x_clipboard_manager_error_1)
(x_clipboard_manager_save_all):
* xterm.c (x_term_init): Use build_local_string.

14 files changed:
src/ChangeLog
src/buffer.c
src/charset.c
src/data.c
src/emacs.c
src/fileio.c
src/fns.c
src/frame.c
src/keyboard.c
src/lread.c
src/xdisp.c
src/xfns.c
src/xselect.c
src/xterm.c

index 2258f58299e9ab1192e8233343f96c8611977649..a920ac1b970bf931046fb1b5add2cff978f1b5da 100644 (file)
@@ -1,3 +1,21 @@
+2014-09-16  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       If USE_LOCAL_ALLOCATORS, allocate even more Lisp objects on stack.
+       * charset.c (load_charset_map_from_file): Use scoped_list2
+       and build_local_string.
+       * buffer.c (Fother_buffer, other_buffer_safely, init_buffer):
+       * emacs.c (init_cmdargs, decode_env_path):
+       * fileio.c (Fexpand_file_name):
+       * fns.c (maybe_resize_hash_table) [ENABLE_CHECKING]:
+       * frame.c (x_get_arg):
+       * keyboard.c (safe_run_hooks_error):
+       * lread.c (load_warn_old_style_backquotes):
+       * xdisp.c (Fcurrent_bidi_paragraph_direction):
+       * xfns.c (x_default_scroll_bar_color_parameter, select_visual):
+       * xselect.c (x_clipboard_manager_error_1)
+       (x_clipboard_manager_save_all):
+       * xterm.c (x_term_init): Use build_local_string.
+
 2014-09-15  Eli Zaretskii  <eliz@gnu.org>
 
        * sound.c [WINDOWSNT]: Include w32common.h and mbstring.h.
index 566a9a1b57628914b58dfa4d6c57cd41f4839864..a68afc6cd4f71011ecd7c76bbca3a13a7282caf8 100644 (file)
@@ -1552,10 +1552,10 @@ exists, return the buffer `*scratch*' (creating it if necessary).  */)
     return notsogood;
   else
     {
-      buf = Fget_buffer (build_string ("*scratch*"));
+      buf = Fget_buffer (build_local_string ("*scratch*"));
       if (NILP (buf))
        {
-         buf = Fget_buffer_create (build_string ("*scratch*"));
+         buf = Fget_buffer_create (build_local_string ("*scratch*"));
          Fset_buffer_major_mode (buf);
        }
       return buf;
@@ -1575,10 +1575,10 @@ other_buffer_safely (Lisp_Object buffer)
     if (candidate_buffer (buf, buffer))
       return buf;
 
-  buf = Fget_buffer (build_string ("*scratch*"));
+  buf = Fget_buffer (build_local_string ("*scratch*"));
   if (NILP (buf))
     {
-      buf = Fget_buffer_create (build_string ("*scratch*"));
+      buf = Fget_buffer_create (build_local_string ("*scratch*"));
       Fset_buffer_major_mode (buf);
     }
 
@@ -5289,7 +5289,7 @@ init_buffer (int initialized)
   initialized = initialized;
 #endif /* USE_MMAP_FOR_BUFFERS */
 
-  Fset_buffer (Fget_buffer_create (build_string ("*scratch*")));
+  Fset_buffer (Fget_buffer_create (build_local_string ("*scratch*")));
   if (NILP (BVAR (&buffer_defaults, enable_multibyte_characters)))
     Fset_buffer_multibyte (Qnil);
 
@@ -5328,7 +5328,7 @@ init_buffer (int initialized)
       && strcmp ("/", SSDATA (BVAR (current_buffer, directory))))
     bset_directory
       (current_buffer,
-       concat2 (build_string ("/:"), BVAR (current_buffer, directory)));
+       concat2 (build_local_string ("/:"), BVAR (current_buffer, directory)));
 
   temp = get_minibuffer (0);
   bset_directory (XBUFFER (temp), BVAR (current_buffer, directory));
index a7bae9d7b017a6ebb67ea32a484ef3159d08f507..3ccac8684be17371aa350faacdef642d709d3c8f 100644 (file)
@@ -490,7 +490,8 @@ load_charset_map_from_file (struct charset *charset, Lisp_Object mapfile,
   int n_entries;
   ptrdiff_t count;
 
-  suffixes = list2 (build_string (".map"), build_string (".TXT"));
+  suffixes = scoped_list2 (build_local_string (".map"),
+                          build_local_string (".TXT"));
 
   count = SPECPDL_INDEX ();
   record_unwind_protect_nothing ();
index 2d6d4c7c22b246c309fa79852a1a318b3e6eb3c7..414da4cf6f7dc40ff271209dc2ff5dd7ac588503 100644 (file)
@@ -983,7 +983,7 @@ wrong_choice (Lisp_Object choice, Lisp_Object wrong)
   USE_SAFE_ALLOCA;
   SAFE_ALLOCA_LISP (args, len * 2 + 1);
 
-  args[i++] = build_string ("One of ");
+  args[i++] = build_local_string ("One of ");
 
   for (obj = choice; !NILP (obj); obj = XCDR (obj))
     {
index 9b05d68b91421b7b5e1100d05974f500398715e9..ed218a7d90ba4fdcb58c10a5a1e696de5d40366f 100644 (file)
@@ -423,7 +423,7 @@ init_cmdargs (int argc, char **argv, int skip_args, char *original_pwd)
      if it would otherwise be treated as magic.  */
   handler = Ffind_file_name_handler (raw_name, Qt);
   if (! NILP (handler))
-    raw_name = concat2 (build_string ("/:"), raw_name);
+    raw_name = concat2 (build_local_string ("/:"), raw_name);
 
   Vinvocation_name = Ffile_name_nondirectory (raw_name);
   Vinvocation_directory = Ffile_name_directory (raw_name);
@@ -441,7 +441,7 @@ init_cmdargs (int argc, char **argv, int skip_args, char *original_pwd)
             if it would otherwise be treated as magic.  */
          handler = Ffind_file_name_handler (found, Qt);
          if (! NILP (handler))
-           found = concat2 (build_string ("/:"), found);
+           found = concat2 (build_local_string ("/:"), found);
          Vinvocation_directory = Ffile_name_directory (found);
        }
     }
@@ -2323,7 +2323,7 @@ decode_env_path (const char *evarname, const char *defalt, bool empty)
             }
 
           if (! NILP (tem))
-            element = concat2 (build_string ("/:"), element);
+            element = concat2 (build_local_string ("/:"), element);
         } /* !NILP (element) */
 
       lpath = Fcons (element, lpath);
index 0b508eae1975d36015d224941e67a4c76302ba83..80905c63d3a2acd8d047a00710ce507ee23c5b46 100644 (file)
@@ -1111,7 +1111,7 @@ filesystem tree, not (expand-file-name ".."  dirname).  */)
 
              name = make_specified_string (nm, -1, p - nm, multibyte);
              temp[0] = DRIVE_LETTER (drive);
-             name = concat2 (build_string (temp), name);
+             name = concat2 (build_local_string (temp), name);
            }
 #ifdef WINDOWSNT
          if (!NILP (Vw32_downcase_file_names))
index 9f56a8f01f50ab0def553334e494982a2e2af153..afe293b6dd3c6aebe840490286d71345ee0600fa 100644 (file)
--- a/src/fns.c
+++ b/src/fns.c
@@ -3994,12 +3994,9 @@ maybe_resize_hash_table (struct Lisp_Hash_Table *h)
 #ifdef ENABLE_CHECKING
       if (HASH_TABLE_P (Vpurify_flag)
          && XHASH_TABLE (Vpurify_flag) == h)
-       {
-         Lisp_Object args[2];
-         args[0] = build_string ("Growing hash table to: %d");
-         args[1] = make_number (new_size);
-         Fmessage (2, args);
-       }
+       Fmessage (2, ((Lisp_Object [])
+         { build_local_string ("Growing hash table to: %d"),
+           make_number (new_size) }));
 #endif
 
       set_hash_key_and_value (h, larger_vector (h->key_and_value,
index 9410031234640e0b2b594693ded9bb1c1c1ee369..cba69373c41cf03f7093334954bd320b9e3d63f3 100644 (file)
@@ -4162,10 +4162,9 @@ x_get_arg (Display_Info *dpyinfo, Lisp_Object alist, Lisp_Object param,
     {
       if (attribute && dpyinfo)
        {
-         tem = display_x_get_resource (dpyinfo,
-                                       build_string (attribute),
-                                       build_string (class),
-                                       Qnil, Qnil);
+         tem = display_x_get_resource
+           (dpyinfo, build_local_string (attribute),
+            build_local_string (class), Qnil, Qnil);
 
          if (NILP (tem))
            return Qunbound;
index a114aa2762667fc941ac3b51a458c22696e357eb..f79c1c94167787cb22b2ae6288c47edd76d40494 100644 (file)
@@ -1894,16 +1894,13 @@ safe_run_hooks_1 (ptrdiff_t nargs, Lisp_Object *args)
 static Lisp_Object
 safe_run_hooks_error (Lisp_Object error, ptrdiff_t nargs, Lisp_Object *args)
 {
-  Lisp_Object hook, fun, msgargs[4];
+  Lisp_Object hook, fun;
 
   eassert (nargs == 2);
   hook = args[0];
   fun = args[1];
-  msgargs[0] = build_string ("Error in %s (%S): %S");
-  msgargs[1] = hook;
-  msgargs[2] = fun;
-  msgargs[3] = error;
-  Fmessage (4, msgargs);
+  Fmessage (4, ((Lisp_Object [])
+    { build_local_string ("Error in %s (%S): %S"), hook, fun, error }));
 
   if (SYMBOLP (hook))
     {
index fabd201003534ce6112b346c53020643a39cf161..f285312e592d3bee6270b1430ebe651994dd7da8 100644 (file)
@@ -969,12 +969,9 @@ static void
 load_warn_old_style_backquotes (Lisp_Object file)
 {
   if (!NILP (Vold_style_backquotes))
-    {
-      Lisp_Object args[2];
-      args[0] = build_string ("Loading `%s': old-style backquotes detected!");
-      args[1] = file;
-      Fmessage (2, args);
-    }
+    Fmessage (2, ((Lisp_Object [])
+      { build_local_string ("Loading `%s': old-style backquotes detected!"),
+       file }));
 }
 
 DEFUN ("get-load-suffixes", Fget_load_suffixes, Sget_load_suffixes, 0, 0, 0,
index 1c6362d03456a99ac237bff7b59ee401c3f8e775..b697b803049a9ef1caa278b1ac768c60be726466 100644 (file)
@@ -20884,7 +20884,7 @@ See also `bidi-paragraph-direction'.  */)
         the previous non-empty line.  */
       if (pos >= ZV && pos > BEGV)
        DEC_BOTH (pos, bytepos);
-      if (fast_looking_at (build_string ("[\f\t ]*\n"),
+      if (fast_looking_at (build_local_string ("[\f\t ]*\n"),
                           pos, bytepos, ZV, ZV_BYTE, Qnil) > 0)
        {
          while ((c = FETCH_BYTE (bytepos)) == '\n'
index ec915a69f80b0e97aef3b7a35aeb34a4bf28c678..683adb2b2103f7640a0669b23b9d6ed40dd72b46 100644 (file)
@@ -1571,13 +1571,13 @@ x_default_scroll_bar_color_parameter (struct frame *f,
 
       /* See if an X resource for the scroll bar color has been
         specified.  */
-      tem = display_x_get_resource (dpyinfo,
-                                   build_string (foreground_p
-                                                 ? "foreground"
-                                                 : "background"),
-                                   empty_unibyte_string,
-                                   build_string ("verticalScrollBar"),
-                                   empty_unibyte_string);
+      tem = display_x_get_resource
+       (dpyinfo, build_local_string (foreground_p
+                                     ? "foreground"
+                                     : "background"),
+        empty_unibyte_string,
+        build_local_string ("verticalScrollBar"),
+        empty_unibyte_string);
       if (!STRINGP (tem))
        {
          /* If nothing has been specified, scroll bars will use a
@@ -4273,13 +4273,12 @@ select_visual (struct x_display_info *dpyinfo)
 {
   Display *dpy = dpyinfo->display;
   Screen *screen = dpyinfo->screen;
-  Lisp_Object value;
 
   /* See if a visual is specified.  */
-  value = display_x_get_resource (dpyinfo,
-                                 build_string ("visualClass"),
-                                 build_string ("VisualClass"),
-                                 Qnil, Qnil);
+  Lisp_Object value = display_x_get_resource
+    (dpyinfo, build_local_string ("visualClass"),
+     build_local_string ("VisualClass"), Qnil, Qnil);
+
   if (STRINGP (value))
     {
       /* VALUE should be of the form CLASS-DEPTH, where CLASS is one
index 6a54b397626d28b02d21423a5d847c467bac088a..0bc7fbc204a0c386987a9dbdd8d2fc646672a95c 100644 (file)
@@ -2159,11 +2159,10 @@ x_clipboard_manager_save (Lisp_Object frame)
 static Lisp_Object
 x_clipboard_manager_error_1 (Lisp_Object err)
 {
-  Lisp_Object args[2];
-  args[0] = build_string ("X clipboard manager error: %s\n\
-If the problem persists, set `x-select-enable-clipboard-manager' to nil.");
-  args[1] = CAR (CDR (err));
-  Fmessage (2, args);
+  Fmessage (2, ((Lisp_Object [])
+    { build_local_string ("X clipboard manager error: %s\n\
+If the problem persists, set `x-select-enable-clipboard-manager' to nil."),
+      CAR (CDR (err)) }));
   return Qnil;
 }
 
@@ -2230,10 +2229,9 @@ x_clipboard_manager_save_all (void)
       local_frame = XCAR (XCDR (XCDR (XCDR (local_selection))));
       if (FRAME_LIVE_P (XFRAME (local_frame)))
        {
-         Lisp_Object args[1];
-         args[0] = build_string ("Saving clipboard to X clipboard manager...");
-         Fmessage (1, args);
-
+         Fmessage (1, ((Lisp_Object [])
+           { build_local_string
+               ("Saving clipboard to X clipboard manager...") }));
          internal_condition_case_1 (x_clipboard_manager_save, local_frame,
                                     Qt, x_clipboard_manager_error_2);
        }
index 8b34167b5adc6f487c4d05d7f0c0926df879849d..1426546d3ae4d289e4d4ced44b0e04fe846cf7e4 100644 (file)
@@ -10946,10 +10946,9 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
       if (dpyinfo->visual->class == PseudoColor)
        {
          Lisp_Object value;
-         value = display_x_get_resource (dpyinfo,
-                                         build_string ("privateColormap"),
-                                         build_string ("PrivateColormap"),
-                                         Qnil, Qnil);
+         value = display_x_get_resource
+           (dpyinfo, build_local_string ("privateColormap"),
+            build_local_string ("PrivateColormap"), Qnil, Qnil);
          if (STRINGP (value)
              && (!strcmp (SSDATA (value), "true")
                  || !strcmp (SSDATA (value), "on")))
@@ -11156,11 +11155,9 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
   /* See if we should run in synchronous mode.  This is useful
      for debugging X code.  */
   {
-    Lisp_Object value;
-    value = display_x_get_resource (dpyinfo,
-                                   build_string ("synchronous"),
-                                   build_string ("Synchronous"),
-                                   Qnil, Qnil);
+    Lisp_Object value = display_x_get_resource
+      (dpyinfo, build_local_string ("synchronous"),
+       build_local_string ("Synchronous"), Qnil, Qnil);
     if (STRINGP (value)
        && (!strcmp (SSDATA (value), "true")
            || !strcmp (SSDATA (value), "on")))
@@ -11168,11 +11165,9 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
   }
 
   {
-    Lisp_Object value;
-    value = display_x_get_resource (dpyinfo,
-                                   build_string ("useXIM"),
-                                   build_string ("UseXIM"),
-                                   Qnil, Qnil);
+    Lisp_Object value = display_x_get_resource
+      (dpyinfo, build_local_string ("useXIM"),
+       build_local_string ("UseXIM"), Qnil, Qnil);
 #ifdef USE_XIM
     if (STRINGP (value)
        && (!strcmp (SSDATA (value), "false")