aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDmitry Antipov2014-09-18 15:34:24 +0400
committerDmitry Antipov2014-09-18 15:34:24 +0400
commit3cab7dd46f43dfb3131a08d7d9fc5c05f221c454 (patch)
tree9f3a11de853f9b84e754e87d568bd6500a5bc24a /src
parente8be4f442baaf84a0d1c9e39b573a77ea9cda908 (diff)
downloademacs-3cab7dd46f43dfb3131a08d7d9fc5c05f221c454.tar.gz
emacs-3cab7dd46f43dfb3131a08d7d9fc5c05f221c454.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog17
-rw-r--r--src/dispnew.c8
-rw-r--r--src/editfns.c2
-rw-r--r--src/fontset.c2
-rw-r--r--src/frame.c2
-rw-r--r--src/frame.h5
-rw-r--r--src/lisp.h2
-rw-r--r--src/process.c2
-rw-r--r--src/xdisp.c6
-rw-r--r--src/xfaces.c16
-rw-r--r--src/xfns.c11
-rw-r--r--src/xfont.c2
12 files changed, 50 insertions, 25 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 010f5fd95dd..0e676e2c73c 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,20 @@
12014-09-18 Dmitry Antipov <dmantipov@yandex.ru>
2
3 More and more stack-allocated Lisp objects if USE_LOCAL_ALLOCATORS.
4 * lisp.h (local_list4) [USE_LOCAL_ALLOCATORS]: New macro.
5 [!USE_LOCAL_ALLOCATORS]: Fall back to regular list4.
6 * frame.h (FRAME_PARAMETER): New macro.
7 * dispnew.c (init_display):
8 * fontset.c (Fset_fontset_font):
9 * frame.c (x_default_parameter):
10 * xfaces.c (set_font_frame_param, Finternal_merge_in_global_face):
11 * xfns.c (x_default_scroll_bar_color_parameter)
12 (x_default_font_parameter, x_create_tip_frame): Use it.
13 * editfns.c (Fpropertize): Use local_cons.
14 * process.c (status_message): Use build_local_string.
15 * xfont.c (xfont_open): Use make_local_string.
16 * xdisp.c (build_desired_tool_bar_string): Use local_list4.
17
12014-09-18 Paul Eggert <eggert@cs.ucla.edu> 182014-09-18 Paul Eggert <eggert@cs.ucla.edu>
2 19
3 Port USE_LOCAL_ALLOCATORS code to clang 3.4 x86-64. 20 Port USE_LOCAL_ALLOCATORS code to clang 3.4 x86-64.
diff --git a/src/dispnew.c b/src/dispnew.c
index bc5164f3ba8..078c1ea2164 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -6098,14 +6098,14 @@ init_display (void)
6098 6098
6099 /* Update frame parameters to reflect the new type. */ 6099 /* Update frame parameters to reflect the new type. */
6100 Fmodify_frame_parameters 6100 Fmodify_frame_parameters
6101 (selected_frame, list1 (Fcons (Qtty_type, 6101 (selected_frame, FRAME_PARAMETER (Qtty_type,
6102 Ftty_type (selected_frame)))); 6102 Ftty_type (selected_frame)));
6103 if (t->display_info.tty->name) 6103 if (t->display_info.tty->name)
6104 Fmodify_frame_parameters 6104 Fmodify_frame_parameters
6105 (selected_frame, 6105 (selected_frame,
6106 list1 (Fcons (Qtty, build_string (t->display_info.tty->name)))); 6106 FRAME_PARAMETER (Qtty, build_string (t->display_info.tty->name)));
6107 else 6107 else
6108 Fmodify_frame_parameters (selected_frame, list1 (Fcons (Qtty, Qnil))); 6108 Fmodify_frame_parameters (selected_frame, FRAME_PARAMETER (Qtty, Qnil));
6109 } 6109 }
6110 6110
6111 { 6111 {
diff --git a/src/editfns.c b/src/editfns.c
index 47779914c45..37fc169ace1 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -3547,7 +3547,7 @@ usage: (propertize STRING &rest PROPERTIES) */)
3547 string = Fcopy_sequence (args[0]); 3547 string = Fcopy_sequence (args[0]);
3548 3548
3549 for (i = 1; i < nargs; i += 2) 3549 for (i = 1; i < nargs; i += 2)
3550 properties = Fcons (args[i], Fcons (args[i + 1], properties)); 3550 properties = local_cons (args[i], local_cons (args[i + 1], properties));
3551 3551
3552 Fadd_text_properties (make_number (0), 3552 Fadd_text_properties (make_number (0),
3553 make_number (SCHARS (string)), 3553 make_number (SCHARS (string)),
diff --git a/src/fontset.c b/src/fontset.c
index a36ae4aa5e3..5e18d14bd65 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -1598,7 +1598,7 @@ appended. By default, FONT-SPEC overrides the previous settings. */)
1598 if (! NILP (font_object)) 1598 if (! NILP (font_object))
1599 { 1599 {
1600 update_auto_fontset_alist (font_object, fontset); 1600 update_auto_fontset_alist (font_object, fontset);
1601 alist = list1 (Fcons (Qfont, Fcons (name, font_object))); 1601 alist = FRAME_PARAMETER (Qfont, Fcons (name, font_object));
1602 Fmodify_frame_parameters (fr, alist); 1602 Fmodify_frame_parameters (fr, alist);
1603 } 1603 }
1604 } 1604 }
diff --git a/src/frame.c b/src/frame.c
index cba69373c41..67993a627e7 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -4274,7 +4274,7 @@ x_default_parameter (struct frame *f, Lisp_Object alist, Lisp_Object prop,
4274 tem = x_frame_get_arg (f, alist, prop, xprop, xclass, type); 4274 tem = x_frame_get_arg (f, alist, prop, xprop, xclass, type);
4275 if (EQ (tem, Qunbound)) 4275 if (EQ (tem, Qunbound))
4276 tem = deflt; 4276 tem = deflt;
4277 x_set_frame_parameters (f, list1 (Fcons (prop, tem))); 4277 x_set_frame_parameters (f, FRAME_PARAMETER (prop, tem));
4278 return tem; 4278 return tem;
4279} 4279}
4280 4280
diff --git a/src/frame.h b/src/frame.h
index 947ba6dccd9..0ba3e3712f6 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -1060,6 +1060,11 @@ default_pixels_per_inch_y (void)
1060 } \ 1060 } \
1061 } while (false) 1061 } while (false)
1062 1062
1063/* Handy macro to construct an argument to Fmodify_frame_parameters. */
1064
1065#define FRAME_PARAMETER(parameter, value) \
1066 local_list1 (scoped_cons (parameter, value))
1067
1063/* False means there are no visible garbaged frames. */ 1068/* False means there are no visible garbaged frames. */
1064extern bool frame_garbaged; 1069extern bool frame_garbaged;
1065 1070
diff --git a/src/lisp.h b/src/lisp.h
index c5e698cc7c7..b8e75f90ef5 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -4623,6 +4623,7 @@ verify (sizeof (struct Lisp_Cons) == sizeof (union Aligned_Cons));
4623# define local_list1(x) local_cons (x, Qnil) 4623# define local_list1(x) local_cons (x, Qnil)
4624# define local_list2(x, y) local_cons (x, local_list1 (y)) 4624# define local_list2(x, y) local_cons (x, local_list1 (y))
4625# define local_list3(x, y, z) local_cons (x, local_list2 (y, z)) 4625# define local_list3(x, y, z) local_cons (x, local_list2 (y, z))
4626# define local_list4(x, y, z, t) local_cons (x, local_list3 (y, z, t))
4626 4627
4627/* Return a function-scoped vector of length SIZE, with each element 4628/* Return a function-scoped vector of length SIZE, with each element
4628 being INIT. */ 4629 being INIT. */
@@ -4673,6 +4674,7 @@ verify (sizeof (struct Lisp_Cons) == sizeof (union Aligned_Cons));
4673# define local_list1(x) list1 (x) 4674# define local_list1(x) list1 (x)
4674# define local_list2(x, y) list2 (x, y) 4675# define local_list2(x, y) list2 (x, y)
4675# define local_list3(x, y, z) list3 (x, y, z) 4676# define local_list3(x, y, z) list3 (x, y, z)
4677# define local_list4(x, y, z, t) list4 (x, y, z, t)
4676# define make_local_vector(size, init) Fmake_vector (make_number (size), init) 4678# define make_local_vector(size, init) Fmake_vector (make_number (size), init)
4677# define make_local_string(data, nbytes) make_string (data, nbytes) 4679# define make_local_string(data, nbytes) make_string (data, nbytes)
4678# define build_local_string(data) build_string (data) 4680# define build_local_string(data) build_string (data)
diff --git a/src/process.c b/src/process.c
index 864aba496eb..0807939dd25 100644
--- a/src/process.c
+++ b/src/process.c
@@ -638,7 +638,7 @@ status_message (struct Lisp_Process *p)
638 { 638 {
639 string = Fnumber_to_string (make_number (code)); 639 string = Fnumber_to_string (make_number (code));
640 string2 = build_local_string ("\n"); 640 string2 = build_local_string ("\n");
641 return concat3 (build_string ("failed with code "), 641 return concat3 (build_local_string ("failed with code "),
642 string, string2); 642 string, string2);
643 } 643 }
644 else 644 else
diff --git a/src/xdisp.c b/src/xdisp.c
index 3a895164fe2..a35cac35e60 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -12061,7 +12061,7 @@ build_desired_tool_bar_string (struct frame *f)
12061 (f, Fmake_string (make_number (size_needed), make_number (' '))); 12061 (f, Fmake_string (make_number (size_needed), make_number (' ')));
12062 else 12062 else
12063 { 12063 {
12064 props = list4 (Qdisplay, Qnil, Qmenu_item, Qnil); 12064 props = local_list4 (Qdisplay, Qnil, Qmenu_item, Qnil);
12065 Fremove_text_properties (make_number (0), make_number (size), 12065 Fremove_text_properties (make_number (0), make_number (size),
12066 props, f->desired_tool_bar_string); 12066 props, f->desired_tool_bar_string);
12067 } 12067 }
@@ -12174,8 +12174,8 @@ build_desired_tool_bar_string (struct frame *f)
12174 the start of this item's properties in the tool-bar items 12174 the start of this item's properties in the tool-bar items
12175 vector. */ 12175 vector. */
12176 image = Fcons (Qimage, plist); 12176 image = Fcons (Qimage, plist);
12177 props = list4 (Qdisplay, image, 12177 props = local_list4 (Qdisplay, image, Qmenu_item,
12178 Qmenu_item, make_number (i * TOOL_BAR_ITEM_NSLOTS)); 12178 make_number (i * TOOL_BAR_ITEM_NSLOTS));
12179 12179
12180 /* Let the last image hide all remaining spaces in the tool bar 12180 /* Let the last image hide all remaining spaces in the tool bar
12181 string. The string can be longer than needed when we reuse a 12181 string. The string can be longer than needed when we reuse a
diff --git a/src/xfaces.c b/src/xfaces.c
index a0998d7cbbc..f788c304bd8 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -3398,7 +3398,7 @@ set_font_frame_param (Lisp_Object frame, Lisp_Object lface)
3398 ASET (lface, LFACE_FONT_INDEX, font); 3398 ASET (lface, LFACE_FONT_INDEX, font);
3399 } 3399 }
3400 f->default_face_done_p = 0; 3400 f->default_face_done_p = 0;
3401 Fmodify_frame_parameters (frame, list1 (Fcons (Qfont, font))); 3401 Fmodify_frame_parameters (frame, FRAME_PARAMETER (Qfont, font));
3402 } 3402 }
3403} 3403}
3404 3404
@@ -3787,18 +3787,18 @@ Default face attributes override any local face attributes. */)
3787 && newface->font) 3787 && newface->font)
3788 { 3788 {
3789 Lisp_Object name = newface->font->props[FONT_NAME_INDEX]; 3789 Lisp_Object name = newface->font->props[FONT_NAME_INDEX];
3790 Fmodify_frame_parameters (frame, list1 (Fcons (Qfont, name))); 3790 Fmodify_frame_parameters (frame, FRAME_PARAMETER (Qfont, name));
3791 } 3791 }
3792 3792
3793 if (STRINGP (gvec[LFACE_FOREGROUND_INDEX])) 3793 if (STRINGP (gvec[LFACE_FOREGROUND_INDEX]))
3794 Fmodify_frame_parameters (frame, 3794 Fmodify_frame_parameters
3795 list1 (Fcons (Qforeground_color, 3795 (frame, FRAME_PARAMETER (Qforeground_color,
3796 gvec[LFACE_FOREGROUND_INDEX]))); 3796 gvec[LFACE_FOREGROUND_INDEX]));
3797 3797
3798 if (STRINGP (gvec[LFACE_BACKGROUND_INDEX])) 3798 if (STRINGP (gvec[LFACE_BACKGROUND_INDEX]))
3799 Fmodify_frame_parameters (frame, 3799 Fmodify_frame_parameters
3800 list1 (Fcons (Qbackground_color, 3800 (frame, FRAME_PARAMETER (Qbackground_color,
3801 gvec[LFACE_BACKGROUND_INDEX]))); 3801 gvec[LFACE_BACKGROUND_INDEX]));
3802 } 3802 }
3803 } 3803 }
3804 3804
diff --git a/src/xfns.c b/src/xfns.c
index 683adb2b210..b107f6e688c 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -1595,7 +1595,7 @@ x_default_scroll_bar_color_parameter (struct frame *f,
1595#endif /* not USE_TOOLKIT_SCROLL_BARS */ 1595#endif /* not USE_TOOLKIT_SCROLL_BARS */
1596 } 1596 }
1597 1597
1598 x_set_frame_parameters (f, list1 (Fcons (prop, tem))); 1598 x_set_frame_parameters (f, FRAME_PARAMETER (prop, tem));
1599 return tem; 1599 return tem;
1600} 1600}
1601 1601
@@ -2846,7 +2846,7 @@ x_default_font_parameter (struct frame *f, Lisp_Object parms)
2846 { 2846 {
2847 /* Remember the explicit font parameter, so we can re-apply it after 2847 /* Remember the explicit font parameter, so we can re-apply it after
2848 we've applied the `default' face settings. */ 2848 we've applied the `default' face settings. */
2849 x_set_frame_parameters (f, list1 (Fcons (Qfont_param, font_param))); 2849 x_set_frame_parameters (f, FRAME_PARAMETER (Qfont_param, font_param));
2850 } 2850 }
2851 2851
2852 /* This call will make X resources override any system font setting. */ 2852 /* This call will make X resources override any system font setting. */
@@ -5036,7 +5036,7 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
5036 5036
5037 /* Add `tooltip' frame parameter's default value. */ 5037 /* Add `tooltip' frame parameter's default value. */
5038 if (NILP (Fframe_parameter (frame, Qtooltip))) 5038 if (NILP (Fframe_parameter (frame, Qtooltip)))
5039 Fmodify_frame_parameters (frame, list1 (Fcons (Qtooltip, Qt))); 5039 Fmodify_frame_parameters (frame, FRAME_PARAMETER (Qtooltip, Qt));
5040 5040
5041 /* FIXME - can this be done in a similar way to normal frames? 5041 /* FIXME - can this be done in a similar way to normal frames?
5042 http://lists.gnu.org/archive/html/emacs-devel/2007-10/msg00641.html */ 5042 http://lists.gnu.org/archive/html/emacs-devel/2007-10/msg00641.html */
@@ -5054,7 +5054,8 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
5054 disptype = intern ("color"); 5054 disptype = intern ("color");
5055 5055
5056 if (NILP (Fframe_parameter (frame, Qdisplay_type))) 5056 if (NILP (Fframe_parameter (frame, Qdisplay_type)))
5057 Fmodify_frame_parameters (frame, list1 (Fcons (Qdisplay_type, disptype))); 5057 Fmodify_frame_parameters
5058 (frame, FRAME_PARAMETER (Qdisplay_type, disptype));
5058 } 5059 }
5059 5060
5060 /* Set up faces after all frame parameters are known. This call 5061 /* Set up faces after all frame parameters are known. This call
@@ -5073,7 +5074,7 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
5073 call2 (Qface_set_after_frame_default, frame, Qnil); 5074 call2 (Qface_set_after_frame_default, frame, Qnil);
5074 5075
5075 if (!EQ (bg, Fframe_parameter (frame, Qbackground_color))) 5076 if (!EQ (bg, Fframe_parameter (frame, Qbackground_color)))
5076 Fmodify_frame_parameters (frame, list1 (Fcons (Qbackground_color, bg))); 5077 Fmodify_frame_parameters (frame, FRAME_PARAMETER (Qbackground_color, bg));
5077 } 5078 }
5078 5079
5079 f->no_split = 1; 5080 f->no_split = 1;
diff --git a/src/xfont.c b/src/xfont.c
index c39c8455aa5..90b69ad5187 100644
--- a/src/xfont.c
+++ b/src/xfont.c
@@ -775,7 +775,7 @@ xfont_open (struct frame *f, Lisp_Object entity, int pixel_size)
775 if (dashes >= 13) 775 if (dashes >= 13)
776 { 776 {
777 len = xfont_decode_coding_xlfd (p0, -1, name); 777 len = xfont_decode_coding_xlfd (p0, -1, name);
778 fullname = Fdowncase (make_string (name, len)); 778 fullname = Fdowncase (make_local_string (name, len));
779 } 779 }
780 XFree (p0); 780 XFree (p0);
781 } 781 }