From owner-svn-src-head@freebsd.org  Thu May  5 16:31:50 2016
Return-Path: <owner-svn-src-head@freebsd.org>
Delivered-To: svn-src-head@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 DF47BB2E243;
 Thu,  5 May 2016 16:31:50 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1])
 (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id BF90A1F39;
 Thu,  5 May 2016 16:31:50 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net
 [73.231.226.104])
 by bigwig.baldwin.cx (Postfix) with ESMTPSA id 49708B94B;
 Thu,  5 May 2016 12:31:49 -0400 (EDT)
From: John Baldwin <jhb@freebsd.org>
To: Alan Somers <asomers@freebsd.org>
Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: Re: svn commit: r299090 - in head: etc/mtree include lib/libbluetooth
 sbin/hastd share/man/man3 sys/dev/xen/blkback sys/kern sys/net sys/sys
 tests/sys tests/sys/sys usr.sbin/bluetooth/hccontrol
Date: Thu, 05 May 2016 09:31:44 -0700
Message-ID: <2368543.Vvp613SNcD@ralph.baldwin.cx>
User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; )
In-Reply-To: <201605042234.u44MYBMX054443@repo.freebsd.org>
References: <201605042234.u44MYBMX054443@repo.freebsd.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7
 (bigwig.baldwin.cx); Thu, 05 May 2016 12:31:49 -0400 (EDT)
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 <svn-src-head.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-head>,
 <mailto:svn-src-head-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-head/>
List-Post: <mailto:svn-src-head@freebsd.org>
List-Help: <mailto:svn-src-head-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-head>,
 <mailto:svn-src-head-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 05 May 2016 16:31:51 -0000

On Wednesday, May 04, 2016 10:34:11 PM Alan Somers wrote:
> Author: asomers
> Date: Wed May  4 22:34:11 2016
> New Revision: 299090
> URL: https://svnweb.freebsd.org/changeset/base/299090
> 
> Log:
>   Improve performance and functionality of the bitstring(3) api
>   
>   Two new functions are provided, bit_ffs_at() and bit_ffc_at(), which allow
>   for efficient searching of set or cleared bits starting from any bit offset
>   within the bit string.
>   
>   Performance is improved by operating on longs instead of bytes and using
>   ffsl() for searches within a long. ffsl() is a compiler builtin in both
>   clang and gcc for most architectures, converting what was a brute force
>   while loop search into a couple of instructions.
>   
>   All of the bitstring(3) API continues to be contained in the header file.
>   Some of the functions are large enough that perhaps they should be uninlined
>   and moved to a library, but that is beyond the scope of this commit.

Doesn't switching from bytes to longs break the ABI?  That is, setting bit 9
now has a different representation on big-endian systems (0x00 0x01 before,
now 0x00 0x00 0x01 0x00 on 32-bit BE, and 4 more leading 0 bytes on 64-bit).
This means you can't have an object file compiled against the old header
pass a bitstring to an object file compiled against the new header on big-endian
systems.

Even on little-endian systems if an old object file allocates storage for a
bitstring the new code might read off the end of it and fault (or return
garbage if bits are set in the extra bytes it reads off the end)?

Is the API is so little used we don't care?

-- 
John Baldwin