emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r117899: More and more stack-allocated Lisp objects


From: Dmitry Antipov
Subject: [Emacs-diffs] trunk r117899: More and more stack-allocated Lisp objects if USE_LOCAL_ALLOCATORS.
Date: Thu, 18 Sep 2014 11:34:47 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117899
revision-id: address@hidden
parent: address@hidden
committer: Dmitry Antipov <address@hidden>
branch nick: trunk
timestamp: Thu 2014-09-18 15:34:24 +0400
message:
  More and more stack-allocated Lisp objects if USE_LOCAL_ALLOCATORS.
  * lisp.h (local_list4) [USE_LOCAL_ALLOCATORS]: New macro.
  [!USE_LOCAL_ALLOCATORS]: Fall back to regular list4.
  * frame.h (FRAME_PARAMETER): New macro.
  * dispnew.c (init_display):
  * fontset.c (Fset_fontset_font):
  * frame.c (x_default_parameter):
  * xfaces.c (set_font_frame_param, Finternal_merge_in_global_face):
  * xfns.c (x_default_scroll_bar_color_parameter)
  (x_default_font_parameter, x_create_tip_frame): Use it.
  * editfns.c (Fpropertize): Use local_cons.
  * process.c (status_message): Use build_local_string.
  * xfont.c (xfont_open): Use make_local_string.
  * xdisp.c (build_desired_tool_bar_string): Use local_list4.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/dispnew.c                  dispnew.c-20091113204419-o5vbwnq5f7feedwu-258
  src/editfns.c                  editfns.c-20091113204419-o5vbwnq5f7feedwu-255
  src/fontset.c                  fontset.c-20091113204419-o5vbwnq5f7feedwu-1079
  src/frame.c                    frame.c-20091113204419-o5vbwnq5f7feedwu-243
  src/frame.h                    frame.h-20091113204419-o5vbwnq5f7feedwu-229
  src/lisp.h                     lisp.h-20091113204419-o5vbwnq5f7feedwu-253
  src/process.c                  process.c-20091113204419-o5vbwnq5f7feedwu-462
  src/xdisp.c                    xdisp.c-20091113204419-o5vbwnq5f7feedwu-240
  src/xfaces.c                   xfaces.c-20091113204419-o5vbwnq5f7feedwu-560
  src/xfns.c                     xfns.c-20091113204419-o5vbwnq5f7feedwu-274
  src/xfont.c                    xfont.c-20091113204419-o5vbwnq5f7feedwu-8547
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2014-09-18 05:40:17 +0000
+++ b/src/ChangeLog     2014-09-18 11:34:24 +0000
@@ -1,3 +1,20 @@
+2014-09-18  Dmitry Antipov  <address@hidden>
+
+       More and more stack-allocated Lisp objects if USE_LOCAL_ALLOCATORS.
+       * lisp.h (local_list4) [USE_LOCAL_ALLOCATORS]: New macro.
+       [!USE_LOCAL_ALLOCATORS]: Fall back to regular list4.
+       * frame.h (FRAME_PARAMETER): New macro.
+       * dispnew.c (init_display):
+       * fontset.c (Fset_fontset_font):
+       * frame.c (x_default_parameter):
+       * xfaces.c (set_font_frame_param, Finternal_merge_in_global_face):
+       * xfns.c (x_default_scroll_bar_color_parameter)
+       (x_default_font_parameter, x_create_tip_frame): Use it.
+       * editfns.c (Fpropertize): Use local_cons.
+       * process.c (status_message): Use build_local_string.
+       * xfont.c (xfont_open): Use make_local_string.
+       * xdisp.c (build_desired_tool_bar_string): Use local_list4.
+
 2014-09-18  Paul Eggert  <address@hidden>
 
        Port USE_LOCAL_ALLOCATORS code to clang 3.4 x86-64.

=== modified file 'src/dispnew.c'
--- a/src/dispnew.c     2014-09-08 06:00:58 +0000
+++ b/src/dispnew.c     2014-09-18 11:34:24 +0000
@@ -6098,14 +6098,14 @@
 
     /* Update frame parameters to reflect the new type. */
     Fmodify_frame_parameters
-      (selected_frame, list1 (Fcons (Qtty_type,
-                                     Ftty_type (selected_frame))));
+      (selected_frame, FRAME_PARAMETER (Qtty_type,
+                                       Ftty_type (selected_frame)));
     if (t->display_info.tty->name)
       Fmodify_frame_parameters
        (selected_frame,
-        list1 (Fcons (Qtty, build_string (t->display_info.tty->name))));
+        FRAME_PARAMETER (Qtty, build_string (t->display_info.tty->name)));
     else
-      Fmodify_frame_parameters (selected_frame, list1 (Fcons (Qtty, Qnil)));
+      Fmodify_frame_parameters (selected_frame, FRAME_PARAMETER (Qtty, Qnil));
   }
 
   {

=== modified file 'src/editfns.c'
--- a/src/editfns.c     2014-09-15 14:53:23 +0000
+++ b/src/editfns.c     2014-09-18 11:34:24 +0000
@@ -3547,7 +3547,7 @@
   string = Fcopy_sequence (args[0]);
 
   for (i = 1; i < nargs; i += 2)
-    properties = Fcons (args[i], Fcons (args[i + 1], properties));
+    properties = local_cons (args[i], local_cons (args[i + 1], properties));
 
   Fadd_text_properties (make_number (0),
                        make_number (SCHARS (string)),

=== modified file 'src/fontset.c'
--- a/src/fontset.c     2014-09-15 14:53:23 +0000
+++ b/src/fontset.c     2014-09-18 11:34:24 +0000
@@ -1598,7 +1598,7 @@
          if (! NILP (font_object))
            {
              update_auto_fontset_alist (font_object, fontset);
-             alist = list1 (Fcons (Qfont, Fcons (name, font_object)));
+             alist = FRAME_PARAMETER (Qfont, Fcons (name, font_object));
              Fmodify_frame_parameters (fr, alist);
            }
        }

=== modified file 'src/frame.c'
--- a/src/frame.c       2014-09-16 08:20:08 +0000
+++ b/src/frame.c       2014-09-18 11:34:24 +0000
@@ -4274,7 +4274,7 @@
   tem = x_frame_get_arg (f, alist, prop, xprop, xclass, type);
   if (EQ (tem, Qunbound))
     tem = deflt;
-  x_set_frame_parameters (f, list1 (Fcons (prop, tem)));
+  x_set_frame_parameters (f, FRAME_PARAMETER (prop, tem));
   return tem;
 }
 

=== modified file 'src/frame.h'
--- a/src/frame.h       2014-09-11 19:44:25 +0000
+++ b/src/frame.h       2014-09-18 11:34:24 +0000
@@ -1060,6 +1060,11 @@
       }                                                                \
   } while (false)
 
+/* Handy macro to construct an argument to Fmodify_frame_parameters.  */
+
+#define FRAME_PARAMETER(parameter, value)      \
+  local_list1 (scoped_cons (parameter, value))
+
 /* False means there are no visible garbaged frames.  */
 extern bool frame_garbaged;
 

=== modified file 'src/lisp.h'
--- a/src/lisp.h        2014-09-18 05:40:17 +0000
+++ b/src/lisp.h        2014-09-18 11:34:24 +0000
@@ -4623,6 +4623,7 @@
 # define local_list1(x) local_cons (x, Qnil)
 # define local_list2(x, y) local_cons (x, local_list1 (y))
 # define local_list3(x, y, z) local_cons (x, local_list2 (y, z))
+# define local_list4(x, y, z, t) local_cons (x, local_list3 (y, z, t))
 
 /* Return a function-scoped vector of length SIZE, with each element
    being INIT.  */
@@ -4673,6 +4674,7 @@
 # define local_list1(x) list1 (x)
 # define local_list2(x, y) list2 (x, y)
 # define local_list3(x, y, z) list3 (x, y, z)
+# define local_list4(x, y, z, t) list4 (x, y, z, t)
 # define make_local_vector(size, init) Fmake_vector (make_number (size), init)
 # define make_local_string(data, nbytes) make_string (data, nbytes)
 # define build_local_string(data) build_string (data)

=== modified file 'src/process.c'
--- a/src/process.c     2014-09-17 15:34:37 +0000
+++ b/src/process.c     2014-09-18 11:34:24 +0000
@@ -638,7 +638,7 @@
     {
       string = Fnumber_to_string (make_number (code));
       string2 = build_local_string ("\n");
-      return concat3 (build_string ("failed with code "),
+      return concat3 (build_local_string ("failed with code "),
                      string, string2);
     }
   else

=== modified file 'src/xdisp.c'
--- a/src/xdisp.c       2014-09-16 11:43:49 +0000
+++ b/src/xdisp.c       2014-09-18 11:34:24 +0000
@@ -12061,7 +12061,7 @@
       (f, Fmake_string (make_number (size_needed), make_number (' ')));
   else
     {
-      props = list4 (Qdisplay, Qnil, Qmenu_item, Qnil);
+      props = local_list4 (Qdisplay, Qnil, Qmenu_item, Qnil);
       Fremove_text_properties (make_number (0), make_number (size),
                               props, f->desired_tool_bar_string);
     }
@@ -12174,8 +12174,8 @@
         the start of this item's properties in the tool-bar items
         vector.  */
       image = Fcons (Qimage, plist);
-      props = list4 (Qdisplay, image,
-                    Qmenu_item, make_number (i * TOOL_BAR_ITEM_NSLOTS));
+      props = local_list4 (Qdisplay, image, Qmenu_item,
+                          make_number (i * TOOL_BAR_ITEM_NSLOTS));
 
       /* Let the last image hide all remaining spaces in the tool bar
          string.  The string can be longer than needed when we reuse a

=== modified file 'src/xfaces.c'
--- a/src/xfaces.c      2014-09-07 07:04:01 +0000
+++ b/src/xfaces.c      2014-09-18 11:34:24 +0000
@@ -3398,7 +3398,7 @@
          ASET (lface, LFACE_FONT_INDEX, font);
        }
       f->default_face_done_p = 0;
-      Fmodify_frame_parameters (frame, list1 (Fcons (Qfont, font)));
+      Fmodify_frame_parameters (frame, FRAME_PARAMETER (Qfont, font));
     }
 }
 
@@ -3787,18 +3787,18 @@
              && newface->font)
            {
              Lisp_Object name = newface->font->props[FONT_NAME_INDEX];
-             Fmodify_frame_parameters (frame, list1 (Fcons (Qfont, name)));
+             Fmodify_frame_parameters (frame, FRAME_PARAMETER (Qfont, name));
            }
 
          if (STRINGP (gvec[LFACE_FOREGROUND_INDEX]))
-           Fmodify_frame_parameters (frame,
-                                     list1 (Fcons (Qforeground_color,
-                                                   
gvec[LFACE_FOREGROUND_INDEX])));
+           Fmodify_frame_parameters
+             (frame, FRAME_PARAMETER (Qforeground_color,
+                                      gvec[LFACE_FOREGROUND_INDEX]));
 
          if (STRINGP (gvec[LFACE_BACKGROUND_INDEX]))
-           Fmodify_frame_parameters (frame,
-                                     list1 (Fcons (Qbackground_color,
-                                                   
gvec[LFACE_BACKGROUND_INDEX])));
+           Fmodify_frame_parameters
+             (frame, FRAME_PARAMETER (Qbackground_color,
+                                      gvec[LFACE_BACKGROUND_INDEX]));
        }
     }
 

=== modified file 'src/xfns.c'
--- a/src/xfns.c        2014-09-16 08:20:08 +0000
+++ b/src/xfns.c        2014-09-18 11:34:24 +0000
@@ -1595,7 +1595,7 @@
 #endif /* not USE_TOOLKIT_SCROLL_BARS */
     }
 
-  x_set_frame_parameters (f, list1 (Fcons (prop, tem)));
+  x_set_frame_parameters (f, FRAME_PARAMETER (prop, tem));
   return tem;
 }
 
@@ -2846,7 +2846,7 @@
     {
       /* Remember the explicit font parameter, so we can re-apply it after
         we've applied the `default' face settings.  */
-      x_set_frame_parameters (f, list1 (Fcons (Qfont_param, font_param)));
+      x_set_frame_parameters (f, FRAME_PARAMETER (Qfont_param, font_param));
     }
 
   /* This call will make X resources override any system font setting.  */
@@ -5036,7 +5036,7 @@
 
   /* Add `tooltip' frame parameter's default value. */
   if (NILP (Fframe_parameter (frame, Qtooltip)))
-    Fmodify_frame_parameters (frame, list1 (Fcons (Qtooltip, Qt)));
+    Fmodify_frame_parameters (frame, FRAME_PARAMETER (Qtooltip, Qt));
 
   /* FIXME - can this be done in a similar way to normal frames?
      http://lists.gnu.org/archive/html/emacs-devel/2007-10/msg00641.html */
@@ -5054,7 +5054,8 @@
       disptype = intern ("color");
 
     if (NILP (Fframe_parameter (frame, Qdisplay_type)))
-      Fmodify_frame_parameters (frame, list1 (Fcons (Qdisplay_type, 
disptype)));
+      Fmodify_frame_parameters
+       (frame, FRAME_PARAMETER (Qdisplay_type, disptype));
   }
 
   /* Set up faces after all frame parameters are known.  This call
@@ -5073,7 +5074,7 @@
     call2 (Qface_set_after_frame_default, frame, Qnil);
 
     if (!EQ (bg, Fframe_parameter (frame, Qbackground_color)))
-      Fmodify_frame_parameters (frame, list1 (Fcons (Qbackground_color, bg)));
+      Fmodify_frame_parameters (frame, FRAME_PARAMETER (Qbackground_color, 
bg));
   }
 
   f->no_split = 1;

=== modified file 'src/xfont.c'
--- a/src/xfont.c       2014-08-25 07:00:42 +0000
+++ b/src/xfont.c       2014-09-18 11:34:24 +0000
@@ -775,7 +775,7 @@
       if (dashes >= 13)
        {
          len = xfont_decode_coding_xlfd (p0, -1, name);
-         fullname = Fdowncase (make_string (name, len));
+         fullname = Fdowncase (make_local_string (name, len));
        }
       XFree (p0);
     }


reply via email to

[Prev in Thread] Current Thread [Next in Thread]