aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorPaul Eggert2012-09-03 23:34:19 -0700
committerPaul Eggert2012-09-03 23:34:19 -0700
commitaf26b72c1187a93cdacc6abb6561f3c331346cef (patch)
tree12dd2afed044c50078a831bf3aaaa981d79586b8 /src/alloc.c
parent7b6c362efe6e32b6a3a68f6f827c9cc558a2fcf0 (diff)
downloademacs-af26b72c1187a93cdacc6abb6561f3c331346cef.tar.gz
emacs-af26b72c1187a93cdacc6abb6561f3c331346cef.zip
Be more systematic about _setjmp vs setjmp.
* alloc.c (test_setjmp, mark_stack): * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]: (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]: (png_load, my_error_exit, jpeg_load): * process.c (send_process_trap, send_process): Uniformly prefer _setjmp and _longjmp to setjmp and longjmp. The underscored versions are up to 30x faster on some hosts. Formerly, the code used setjmp+longjmp sometimes and _setjmp+_longjmp at other times, with no particular reason to prefer setjmp+longjmp.
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 188a514376d..edecd51f1ac 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -4764,7 +4764,7 @@ test_setjmp (void)
4764 x = strlen (buf); 4764 x = strlen (buf);
4765 x = 2 * x - 1; 4765 x = 2 * x - 1;
4766 4766
4767 setjmp (jbuf); 4767 _setjmp (jbuf);
4768 if (longjmps_done == 1) 4768 if (longjmps_done == 1)
4769 { 4769 {
4770 /* Came here after the longjmp at the end of the function. 4770 /* Came here after the longjmp at the end of the function.
@@ -4789,7 +4789,7 @@ test_setjmp (void)
4789 ++longjmps_done; 4789 ++longjmps_done;
4790 x = 2; 4790 x = 2;
4791 if (longjmps_done == 1) 4791 if (longjmps_done == 1)
4792 longjmp (jbuf, 1); 4792 _longjmp (jbuf, 1);
4793} 4793}
4794 4794
4795#endif /* not GC_SAVE_REGISTERS_ON_STACK && not GC_SETJMP_WORKS */ 4795#endif /* not GC_SAVE_REGISTERS_ON_STACK && not GC_SETJMP_WORKS */
@@ -4931,7 +4931,7 @@ mark_stack (void)
4931 } 4931 }
4932#endif /* GC_SETJMP_WORKS */ 4932#endif /* GC_SETJMP_WORKS */
4933 4933
4934 setjmp (j.j); 4934 _setjmp (j.j);
4935 end = stack_grows_down_p ? (char *) &j + sizeof j : (char *) &j; 4935 end = stack_grows_down_p ? (char *) &j + sizeof j : (char *) &j;
4936#endif /* not GC_SAVE_REGISTERS_ON_STACK */ 4936#endif /* not GC_SAVE_REGISTERS_ON_STACK */
4937#endif /* not HAVE___BUILTIN_UNWIND_INIT */ 4937#endif /* not HAVE___BUILTIN_UNWIND_INIT */