+2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
+
+ 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.
+
2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
Fix minor problem found by static checking.
#if (PNG_LIBPNG_VER < 10500)
-#define PNG_LONGJMP(ptr) (longjmp ((ptr)->jmpbuf, 1))
+#define PNG_LONGJMP(ptr) (_longjmp ((ptr)->jmpbuf, 1))
#define PNG_JMPBUF(ptr) ((ptr)->jmpbuf)
#else
/* In libpng version 1.5, the jmpbuf member is hidden. (Bug#7908) */
#define PNG_LONGJMP(ptr) (fn_png_longjmp ((ptr), 1))
#define PNG_JMPBUF(ptr) \
- (*fn_png_set_longjmp_fn ((ptr), longjmp, sizeof (jmp_buf)))
+ (*fn_png_set_longjmp_fn ((ptr), _longjmp, sizeof (jmp_buf)))
#endif
/* Error and warning handlers installed when the PNG library
/* Set error jump-back. We come back here when the PNG library
detects an error. */
- if (setjmp (PNG_JMPBUF (png_ptr)))
+ if (_setjmp (PNG_JMPBUF (png_ptr)))
{
error:
if (png_ptr)
my_error_exit (j_common_ptr cinfo)
{
struct my_jpeg_error_mgr *mgr = (struct my_jpeg_error_mgr *) cinfo->err;
- longjmp (mgr->setjmp_buffer, 1);
+ _longjmp (mgr->setjmp_buffer, 1);
}
cinfo.err = fn_jpeg_std_error (&mgr.pub);
mgr.pub.error_exit = my_error_exit;
- if ((rc = setjmp (mgr.setjmp_buffer)) != 0)
+ if ((rc = _setjmp (mgr.setjmp_buffer)) != 0)
{
if (rc == 1)
{
if (!check_image_size (f, width, height))
{
image_error ("Invalid image size (see `max-image-size')", Qnil, Qnil);
- longjmp (mgr.setjmp_buffer, 2);
+ _longjmp (mgr.setjmp_buffer, 2);
}
/* Create X image and pixmap. */
if (!x_create_x_image_and_pixmap (f, width, height, 0, &ximg, &img->pixmap))
- longjmp (mgr.setjmp_buffer, 2);
+ _longjmp (mgr.setjmp_buffer, 2);
/* Allocate colors. When color quantization is used,
cinfo.actual_number_of_colors has been set with the number of
{
SIGNAL_THREAD_CHECK (SIGPIPE);
sigunblock (sigmask (SIGPIPE));
- longjmp (send_process_frame, 1);
+ _longjmp (send_process_frame, 1);
}
/* In send_process, when a write fails temporarily,
/* 2000-09-21: Emacs 20.7, sparc-sun-solaris-2.6, GCC 2.95.2,
CFLAGS="-g -O": The value of the parameter `proc' is clobbered
when returning with longjmp despite being declared volatile. */
- if (!setjmp (send_process_frame))
+ if (!_setjmp (send_process_frame))
{
p = XPROCESS (proc); /* Repair any setjmp clobbering. */
process_sent_to = proc;