git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/5] string-list: make string_list_sort() reentrant
@ 2017-01-22 17:47 René Scharfe
  2017-01-22 17:51 ` [PATCH v2 1/5] compat: add qsort_s() René Scharfe
                   ` (6 more replies)
  0 siblings, 7 replies; 18+ messages in thread
From: René Scharfe @ 2017-01-22 17:47 UTC (permalink / raw)
  To: Git List; +Cc: Jeff King, Junio C Hamano, Johannes Schindelin

Use qsort_s() from C11 Annex K to make string_list_sort() safer, in
particular when called from parallel threads.

Changes from v1:
* Renamed HAVE_QSORT_S to HAVE_ISO_QSORT_S in Makefile to disambiguate.
* Added basic perf test (patch 3).
* Converted a second caller to QSORT_S, in ref-filter.c (patch 5).

  compat: add qsort_s()
  add QSORT_S
  perf: add basic sort performance test
  string-list: use QSORT_S in string_list_sort()
  ref-filter: use QSORT_S in ref_array_sort()

 Makefile                    |  8 ++++++
 compat/qsort_s.c            | 69 +++++++++++++++++++++++++++++++++++++++++++++
 git-compat-util.h           | 11 ++++++++
 ref-filter.c                |  6 ++--
 string-list.c               | 13 ++++-----
 t/helper/test-string-list.c | 25 ++++++++++++++++
 t/perf/p0071-sort.sh        | 26 +++++++++++++++++
 7 files changed, 146 insertions(+), 12 deletions(-)
 create mode 100644 compat/qsort_s.c
 create mode 100755 t/perf/p0071-sort.sh

-- 
2.11.0


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2017-01-26 13:49 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-22 17:47 [PATCH v2 0/5] string-list: make string_list_sort() reentrant René Scharfe
2017-01-22 17:51 ` [PATCH v2 1/5] compat: add qsort_s() René Scharfe
2017-01-22 17:52 ` [PATCH v2 2/5] add QSORT_S René Scharfe
2017-01-22 17:53 ` [PATCH v2 3/5] perf: add basic sort performance test René Scharfe
2017-01-22 17:57 ` [PATCH v2 4/5] string-list: use QSORT_S in string_list_sort() René Scharfe
2017-01-22 17:58 ` [PATCH v2 5/5] ref-filter: use QSORT_S in ref_array_sort() René Scharfe
2017-01-22 18:02 ` [DEMO][PATCH v2 6/5] compat: add a qsort_s() implementation based on GNU's qsort_r(1) René Scharfe
2017-01-23 19:07   ` Junio C Hamano
2017-01-24 18:00     ` René Scharfe
2017-01-24 20:39       ` Jeff King
2017-01-25 18:43         ` René Scharfe
2017-01-25 18:51           ` Jeff King
2017-01-26 13:49             ` Johannes Schindelin
2017-01-23 23:54 ` [PATCH v2 0/5] string-list: make string_list_sort() reentrant Jeff King
2017-01-24 11:44   ` Johannes Schindelin
2017-01-24 13:44     ` Jeff King
2017-01-24 18:00   ` René Scharfe
2017-01-24 20:41     ` Jeff King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).