From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/6041 Path: news.gmane.org!not-for-mail From: Bobby Bingham Newsgroups: gmane.linux.lib.musl.general Subject: Re: [RFC] new qsort implementation Date: Mon, 1 Sep 2014 16:46:23 -0500 Message-ID: <20140901214623.GA10395@duality.lan> References: <20140901071243.GA6828@duality.lan> <20140901111748.GD27258@port70.net> <20140901182005.GA7301@duality.lan> <20140901205342.GE12888@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="cWoXeonUoKmBZSoM" X-Trace: ger.gmane.org 1409608329 6020 80.91.229.3 (1 Sep 2014 21:52:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 1 Sep 2014 21:52:09 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-6048-gllmg-musl=m.gmane.org@lists.openwall.com Mon Sep 01 23:51:57 2014 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1XOZVz-0004W8-O6 for gllmg-musl@plane.gmane.org; Mon, 01 Sep 2014 23:51:55 +0200 Original-Received: (qmail 3922 invoked by uid 550); 1 Sep 2014 21:51:55 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 3914 invoked from network); 1 Sep 2014 21:51:54 -0000 Content-Disposition: inline In-Reply-To: <20140901205342.GE12888@brightrain.aerifal.cx> X-Operating-System: Linux duality 3.13.5-gentoo User-Agent: Mutt/1.5.22 (2013-10-16) Xref: news.gmane.org gmane.linux.lib.musl.general:6041 Archived-At: --cWoXeonUoKmBZSoM Content-Type: text/plain; charset=utf-8 Content-Disposition: inline On Mon, Sep 01, 2014 at 04:53:42PM -0400, Rich Felker wrote: > > I thought I recalled hearing that SSIZE_MAX was the upper bound on all > > object sizes in musl, but if we still allow larger mmaps than that, I > > guess not. I'll find a different approach when I send the next version > > of the code. > > You are correct and nsz is mistaken on this. musl does not permit any > object size larger than SSIZE_MAX. mmap and malloc both enforce this. > But I'm not sure why you've written bsearch to need this assumption. > The bsearch in musl gets by fine without it. The point of this was that bsearch returns NULL if the element is not found, but I need to know where the element would have been had it been present. The bitwise complement is used so that bsearch, written as a wrapper around __bsearch, can tell whether the element was present or not without requiring an extra comparison. -- Bobby Bingham --cWoXeonUoKmBZSoM Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJUBOkvAAoJEFedFv6RmqC9K+cQAI96mPbEXcnw9IM6ejL+XT+v dTTcC5NUZPwdbbjdS4YfdPjaUXfpXIC+kcgJYxZb1JTw0CYYoNYPukaQnDWAr6IH c4xmU6VpO9FX2IMIBoGhSfDCwQm6yaflGXlwug/OGxCoEviQw5w2mINpA8nLzFuE Qev01Xzz0w68bOx/0Sb8XcyotzFskONOHB+Ed9f2KIWyx54r7R5ehWE54ODgVNTk a6LmgW3jrHOgQCltsEWn4+T5exha+Jv6j+h0rCfSstpMJWNJqj50dRGrxaj+6YiJ ObAQjNbOqsIfC4CuapaIdJDY0s690bsull2jjVdMRbFMso/kAZp0ffcCd3/gJV/s E7l33beDmMKN8swZ2hjCizcrnpZEZ3YV2RoBqT4132CJWeT/A6vpDDceGOr+MNGj blGHZB3co2sZf2bngCPxVAtfK4aMXAADpGXeki/3/zpEaK4lHXpSvPOtF1c5f3R4 xo1krO8T0akDTcN+QwCY3gX/ustZ1osB7hshBmQds7FLUow3zwtWl0isDdMfeYWK Ot0cnS49sEyAYPgiJdkCvEFdx08qXaJcsLEbKdcTaqQ/lZTLrEJIzLihTRi5OZUG JLBhJjDOQAkU5ouNbxfWKdEQvSNaIBgWoWr2gJGbNRdB592gI5zIgRkTQa6ThCn9 dap7aZad6VA8uoNyC5b7 =eYC8 -----END PGP SIGNATURE----- --cWoXeonUoKmBZSoM--