[PATCH] add memrchr(3)

Eric Blake eblake@redhat.com
Thu May 10 06:57:00 GMT 2012

On 05/09/2012 09:17 AM, Yaakov (Cygwin/X) wrote:
> On Wed, 2012-05-09 at 10:48 -0400, Christopher Faylor wrote: 
>> Why not just grab the source from FreeBSD?
>> http://svnweb.freebsd.org/base/head/lib/libc/string/memrchr.c?revision=178051&view=markup
>> (or actually from OpenBSD since that's where the above originated)
> That would have been easy, but then everyone would be complaining that
> its not optimized for speed. :-)

How hard could it be to take memchr.c, and flip the boundary conditions
to start from high to low instead of low to high?  Then you'll have at a
version optimized at least for C (it can be further optimized by
assembly, but that's going above and beyond what it takes to get a new
interface in).

Eric Blake   eblake@redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://sourceware.org/pipermail/newlib/attachments/20120510/99e70b36/attachment.sig>

More information about the Newlib mailing list