svn commit: r304911 - head/lib/libc/net
Andrey Chernov
ache at freebsd.org
Sat Aug 27 19:08:50 UTC 2016
On 27.08.2016 20:37, Brooks Davis wrote:
> On Sat, Aug 27, 2016 at 02:43:13PM +0000, Andrey A. Chernov wrote:
>> Author: ache
>> Date: Sat Aug 27 14:43:13 2016
>> New Revision: 304911
>> URL: https://svnweb.freebsd.org/changeset/base/304911
>>
>> Log:
>> The formal behavior of qsort is unstable with regard to objects that
>> are equal. Unfortunately, RFC 3484 requires that otherwise equal objects
>> remain in the order supplied by the DNS server. The present code attempts
>> to deal with this by returning -1 for objects that are equal (i.e.,
>> returns that the first parameter is less then the second parameter).
>> Unfortunately, the qsort API does not state that the first parameter
>> passed in is in any particular position in the list.
>
> Why not switch to mergesort which is stable by design?
megresort() is 1) slower 2) requires additional memory allocated.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/svn-src-head/attachments/20160827/4ff85298/attachment.sig>
More information about the svn-src-head
mailing list