diff options
| author | Paul Eggert | 2018-06-28 00:37:08 -0700 |
|---|---|---|
| committer | Paul Eggert | 2018-06-28 00:42:46 -0700 |
| commit | 76eda952b09db6d79342b7ddfcae45c7c836ab62 (patch) | |
| tree | c1283adb00332f30c98e46da61e427057948aacc /src/callproc.c | |
| parent | 79f6911bf1f6262c723f5a3602c2f80cbe63cf54 (diff) | |
| download | emacs-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/callproc.c')
| -rw-r--r-- | src/callproc.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/callproc.c b/src/callproc.c index 973f324139c..17eb8132d96 100644 --- a/src/callproc.c +++ b/src/callproc.c | |||
| @@ -599,7 +599,6 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd, | |||
| 599 | Lisp_Object volatile coding_systems_volatile = coding_systems; | 599 | Lisp_Object volatile coding_systems_volatile = coding_systems; |
| 600 | Lisp_Object volatile current_dir_volatile = current_dir; | 600 | Lisp_Object volatile current_dir_volatile = current_dir; |
| 601 | bool volatile display_p_volatile = display_p; | 601 | bool volatile display_p_volatile = display_p; |
| 602 | bool volatile sa_must_free_volatile = sa_must_free; | ||
| 603 | int volatile fd_error_volatile = fd_error; | 602 | int volatile fd_error_volatile = fd_error; |
| 604 | int volatile filefd_volatile = filefd; | 603 | int volatile filefd_volatile = filefd; |
| 605 | ptrdiff_t volatile count_volatile = count; | 604 | ptrdiff_t volatile count_volatile = count; |
| @@ -616,7 +615,6 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd, | |||
| 616 | coding_systems = coding_systems_volatile; | 615 | coding_systems = coding_systems_volatile; |
| 617 | current_dir = current_dir_volatile; | 616 | current_dir = current_dir_volatile; |
| 618 | display_p = display_p_volatile; | 617 | display_p = display_p_volatile; |
| 619 | sa_must_free = sa_must_free_volatile; | ||
| 620 | fd_error = fd_error_volatile; | 618 | fd_error = fd_error_volatile; |
| 621 | filefd = filefd_volatile; | 619 | filefd = filefd_volatile; |
| 622 | count = count_volatile; | 620 | count = count_volatile; |
| @@ -885,8 +883,7 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd, | |||
| 885 | when exiting. */ | 883 | when exiting. */ |
| 886 | synch_process_pid = 0; | 884 | synch_process_pid = 0; |
| 887 | 885 | ||
| 888 | SAFE_FREE (); | 886 | SAFE_FREE_UNBIND_TO (count, Qnil); |
| 889 | unbind_to (count, Qnil); | ||
| 890 | 887 | ||
| 891 | if (!wait_ok) | 888 | if (!wait_ok) |
| 892 | return build_unibyte_string ("internal error"); | 889 | return build_unibyte_string ("internal error"); |