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