summaryrefslogtreecommitdiff
path: root/src/lisp.h
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2017-09-26 16:31:57 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2017-09-26 16:36:43 -0700
commit0e82fa34163dba21121e3a9cffa7f896c81c4d93 (patch)
tree16c728aa616dae256d429060e257313dcfe4dbde /src/lisp.h
parent98a37e60142340b9c2b4e6b17c373f4ae6a2d8b4 (diff)
downloademacs-0e82fa34163dba21121e3a9cffa7f896c81c4d93.tar.gz
Avoid some unnecessary copying in Fformat etc.
This patch is just for performance; it should not affect behavior. On my platform, it made the microbenchmark (format "%S" load-path) run about 45% faster. It should also speed up calls like (message "%s" STRING). * src/callint.c (Fcall_interactively): * src/dbusbind.c (XD_OBJECT_TO_STRING): * src/editfns.c (Fmessage, Fmessage_box): * src/xdisp.c (vadd_to_log, Ftrace_to_stderr): Use styled_format instead of Fformat or Fformat_message, to avoid unnecessary copying. * src/editfns.c (styled_format): New arg NEW_RESULT. All uses changed. Reuse an input string if it has the right value and if !NEW_RESULT. * src/lisp.h (style_format): New decl.
Diffstat (limited to 'src/lisp.h')
-rw-r--r--src/lisp.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/lisp.h b/src/lisp.h
index c5030824427..0c3ca3ae06b 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -3969,6 +3969,7 @@ extern _Noreturn void time_overflow (void);
extern Lisp_Object make_buffer_string (ptrdiff_t, ptrdiff_t, bool);
extern Lisp_Object make_buffer_string_both (ptrdiff_t, ptrdiff_t, ptrdiff_t,
ptrdiff_t, bool);
+extern Lisp_Object styled_format (ptrdiff_t, Lisp_Object *, bool, bool);
extern void init_editfns (bool);
extern void syms_of_editfns (void);