aboutsummaryrefslogtreecommitdiffstats
path: root/src/regex.c
diff options
context:
space:
mode:
authorPaul Eggert2018-06-28 00:37:08 -0700
committerPaul Eggert2018-06-28 00:42:46 -0700
commit76eda952b09db6d79342b7ddfcae45c7c836ab62 (patch)
treec1283adb00332f30c98e46da61e427057948aacc /src/regex.c
parent79f6911bf1f6262c723f5a3602c2f80cbe63cf54 (diff)
downloademacs-76eda952b09db6d79342b7ddfcae45c7c836ab62.tar.gz
emacs-76eda952b09db6d79342b7ddfcae45c7c836ab62.zip
Tune SAFE_FREE
On my platform (Fedora 28 x86-64, AMD Phenom II X4 910e) this sped up a SAFE_FREE-using microbenchmark (string-distance "abc" "abc") by about 18%, and shrank the Emacs text size by about 0.1%. * src/callint.c (Fcall_interactively): * src/callproc.c (call_process): * src/doc.c (get_doc_string, Fsnarf_documentation): * src/editfns.c (Freplace_buffer_contents): * src/emacs-module.c (funcall_module): * src/eval.c (Flet): * src/process.c (Fmake_process): * src/term.c (tty_menu_show): * src/xdisp.c (safe__call): * src/xmenu.c (x_menu_show): Use SAFE_FREE_UNBIND_TO. * src/data.c (wrong_choice): No need to call SAFE_FREE here. * src/lisp.h (USE_SAFE_ALLOCA): * src/regex.c (REGEX_USE_SAFE_ALLOCA): Do not declare sa_must_free local; no longer needed. All uses removed. (SAFE_FREE): Rewrite in terms of safe_free. (safe_free): New function, optimized to use xfree. (SAFE_FREE_UNBIND_TO): New macro. (safe_free_unbind_to): New function.
Diffstat (limited to 'src/regex.c')
-rw-r--r--src/regex.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/regex.c b/src/regex.c
index b8c6f3f19b2..6ee13c4c99d 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -455,7 +455,7 @@ ptrdiff_t emacs_re_safe_alloca = MAX_ALLOCA;
455/* Like USE_SAFE_ALLOCA, but use emacs_re_safe_alloca. */ 455/* Like USE_SAFE_ALLOCA, but use emacs_re_safe_alloca. */
456# define REGEX_USE_SAFE_ALLOCA \ 456# define REGEX_USE_SAFE_ALLOCA \
457 ptrdiff_t sa_avail = emacs_re_safe_alloca; \ 457 ptrdiff_t sa_avail = emacs_re_safe_alloca; \
458 ptrdiff_t sa_count = SPECPDL_INDEX (); bool sa_must_free = false 458 ptrdiff_t sa_count = SPECPDL_INDEX ()
459 459
460# define REGEX_SAFE_FREE() SAFE_FREE () 460# define REGEX_SAFE_FREE() SAFE_FREE ()
461# define REGEX_ALLOCATE SAFE_ALLOCA 461# define REGEX_ALLOCATE SAFE_ALLOCA