Paul Eggert
f9caea8233
Vector-sorting fixes.
...
It's not safe to call qsort or qsort_r, since they have undefined
behavior if the user-specified predicate is not a total order.
Also, watch out for garbage-collection while sorting vectors.
* admin/merge-gnulib (GNULIB_MODULES): Add vla.
* configure.ac (qsort_r): Remove, as we no longer use qsort-like
functions.
* lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
* lib/vla.h, m4/vararrays.m4: New files, copied from gnulib.
* lib/stdlib.in.h, m4/stdlib_h.m4: Sync from gnulib, incorporating:
2014-08-29 qsort_r: new module, for GNU-style qsort_r
The previous two files' changes are boilerplate generated by
admin/merge-gnulib, and should not affect Emacs.
* src/fns.c: Include <vla.h>.
(sort_vector_predicate) [!HAVE_QSORT_R]: Remove.
(sort_vector_compare): Remove, replacing with ....
(inorder, merge_vectors, sort_vector_inplace, sort_vector_copy):
... these new functions.
(sort_vector): Rewrite to use the new functions.
GCPRO locals, since the predicate can invoke the GC.
Since it's in-place return void; caller changed.
(merge): Use 'inorder', for clarity.
Fixes: debbugs:18361
2014-08-30 15:59:39 -07:00
..
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-06-01 16:58:38 -07:00
2014-06-17 09:09:19 -07:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2013-07-09 10:16:21 -07:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2012-11-03 11:54:17 -07:00
2013-10-07 14:37:19 -07:00
2014-01-01 07:43:34 +00:00
2013-10-07 14:37:19 -07:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-06-11 13:03:46 -07:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-06-01 16:58:38 -07:00
2014-08-08 23:57:59 -07:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 00:31:29 -08:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-08-30 15:59:39 -07:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-06-14 17:17:21 -07:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-07-12 13:02:44 -07:00
2013-01-31 22:30:51 -08:00
2014-01-01 07:43:34 +00:00
2014-05-26 22:55:18 -07:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-08-10 14:06:07 -07:00
2014-08-10 13:40:57 -07:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-20 12:48:14 -08:00
2014-01-01 07:43:34 +00:00
2014-03-07 10:57:11 -08:00
2014-01-01 07:43:34 +00:00
2014-08-30 15:59:39 -07:00
2014-03-25 21:16:13 -07:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-20 12:48:14 -08:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-08-08 23:57:59 -07:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-03-07 10:57:11 -08:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-02-05 11:41:03 -08:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2012-11-30 10:25:59 -08:00
2014-02-25 11:21:05 -08:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-01-01 07:43:34 +00:00
2014-08-30 15:59:39 -07:00
2014-01-01 07:43:34 +00:00