Commit b98b1a83 authored by Dmitry Antipov's avatar Dmitry Antipov
Browse files

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.
parent 3a41eb66
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.
......
......@@ -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));
......
......@@ -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 ();
......
......@@ -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))
{
......
......@@ -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);
......
......@@ -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))
......
......@@ -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,
......
......@@ -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;
......
......@@ -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))
{
......
......@@ -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,
......
......@@ -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'
......
......@@ -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
......
......@@ -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);
}
......
......@@ -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")
......
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