Skip to content

string-list: make string_list_sort() reentrant

René Scharfe git 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest5 patches 12 repliesIn review
  2. v13 patches 12 repliesSuperseded

Changes in v2 from the cover letter

* 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).

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5compat: add qsort_s()Makefile compat/qsort_s.c git-compat-util.h+83 -00 replies
2/5add QSORT_Sgit-compat-util.h+5 -00 replies
3/5perf: add basic sort performance testt/helper/test-string-list.c t/perf/p0071-sort.sh+51 -00 replies
4/5string-list: use QSORT_S in string_list_sort()string-list.c+5 -80 replies
5/5ref-filter: use QSORT_S in ref_array_sort()ref-filter.c+2 -40 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/5] string-list: make string_list_sort() reentrant

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
Signature · 1 line
2.11.0