From owner-freebsd-current@freebsd.org Mon Apr 18 11:40:24 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A858B11A5E for ; Mon, 18 Apr 2016 11:40:24 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 094F71726 for ; Mon, 18 Apr 2016 11:40:23 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 9DE311FE023 for ; Mon, 18 Apr 2016 13:40:21 +0200 (CEST) To: FreeBSD Current From: Hans Petter Selasky Subject: qsort() documentation Message-ID: <5714C86A.8050204@selasky.org> Date: Mon, 18 Apr 2016 13:43:38 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 11:40:24 -0000 Hi, Are there any objections adding the following as part of documenting our kernel's qsort function? Index: sys/libkern/qsort.c =================================================================== --- sys/libkern/qsort.c (revision 298202) +++ sys/libkern/qsort.c (working copy) @@ -45,6 +45,10 @@ /* * Qsort routine from Bentley & McIlroy's "Engineering a Sort Function". + * + * NOTE: This implementation of qsort() was designed to not have the + * worst case complexity of N**2, as seen with the regular quick sort + * functions as described by Wikipedia. */ --HPS