Commit 3cab7dd4 authored by Dmitry Antipov's avatar Dmitry Antipov

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.
parent e8be4f44
2014-09-18 Dmitry Antipov <dmantipov@yandex.ru>
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 <eggert@cs.ucla.edu>
Port USE_LOCAL_ALLOCATORS code to clang 3.4 x86-64.
......
......@@ -6098,14 +6098,14 @@ init_display (void)
/* 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));
}
{
......
......@@ -3547,7 +3547,7 @@ usage: (propertize STRING &rest PROPERTIES) */)
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)),
......
......@@ -1598,7 +1598,7 @@ appended. By default, FONT-SPEC overrides the previous settings. */)
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);
}
}
......
......@@ -4274,7 +4274,7 @@ x_default_parameter (struct frame *f, Lisp_Object alist, Lisp_Object prop,
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;
}
......
......@@ -1060,6 +1060,11 @@ default_pixels_per_inch_y (void)
} \
} 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;
......
......@@ -4623,6 +4623,7 @@ verify (sizeof (struct Lisp_Cons) == sizeof (union Aligned_Cons));
# 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 @@ verify (sizeof (struct Lisp_Cons) == sizeof (union Aligned_Cons));
# 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)
......
......@@ -638,7 +638,7 @@ status_message (struct Lisp_Process *p)
{
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
......
......@@ -12061,7 +12061,7 @@ build_desired_tool_bar_string (struct frame *f)
(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 @@ build_desired_tool_bar_string (struct frame *f)
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
......
......@@ -3398,7 +3398,7 @@ set_font_frame_param (Lisp_Object frame, Lisp_Object lface)
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 @@ Default face attributes override any local face attributes. */)
&& 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]));
}
}
......
......@@ -1595,7 +1595,7 @@ x_default_scroll_bar_color_parameter (struct frame *f,
#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 @@ x_default_font_parameter (struct frame *f, Lisp_Object parms)
{
/* 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 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
/* 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 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
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 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
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;
......
......@@ -775,7 +775,7 @@ xfont_open (struct frame *f, Lisp_Object entity, int pixel_size)
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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment