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

2017-01-24 Thread Jeff King
On Tue, Jan 24, 2017 at 07:00:07PM +0100, René Scharfe wrote: > Am 24.01.2017 um 00:54 schrieb Jeff King: > > The speed looks like a reasonable outcome. I'm torn on the qsort_r() > > demo patch. I don't think it looks too bad. OTOH, I don't think I would > > want to deal with the

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

2017-01-24 Thread René Scharfe
Am 24.01.2017 um 00:54 schrieb Jeff King: The speed looks like a reasonable outcome. I'm torn on the qsort_r() demo patch. I don't think it looks too bad. OTOH, I don't think I would want to deal with the opposite-argument-order versions. The code itself may look OK, but it's not really

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

2017-01-24 Thread Jeff King
On Tue, Jan 24, 2017 at 12:44:10PM +0100, Johannes Schindelin wrote: > Hi Peff, > > On Mon, 23 Jan 2017, Jeff King wrote: > > > Is there any interest in people adding the ISO qsort_s() to their libc > > implementations? It seems like it's been a fair number of years by now. > > Visual C

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

2017-01-24 Thread Johannes Schindelin
Hi Peff, On Mon, 23 Jan 2017, Jeff King wrote: > Is there any interest in people adding the ISO qsort_s() to their libc > implementations? It seems like it's been a fair number of years by now. Visual C supports it *at least* since Visual Studio 2005:

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

2017-01-23 Thread Jeff King
On Sun, Jan 22, 2017 at 06:47:18PM +0100, René Scharfe wrote: > 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

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

2017-01-22 Thread René Scharfe
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