douglas.bagnall at catalyst.net.nz
Sat Mar 24 04:53:37 UTC 2018
On 24/03/18 14:15, Timur I. Bakeyev via samba-technical wrote:
> On unrelated note I want to remind everyone that at least for FreeBSD:
> The algorithms implemented by qsort(), qsort_r(), and heapsort() are _not_
> stable, that is, if two members compare as equal, their order in the
> sorted array is undefined.
> We've been bitten by this at least once. So something to keep in mind...
This is actually also true with linux/glibc under memory pressure, where qsort()
et. al. abandon their surreptitious attempts at mergesort:
The documentation explicitly disclaims sort stability.
More information about the samba-technical