History log of /freebsd-10.1-release/lib/libc/string/strlen.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 272461 02-Oct-2014 gjb

Copy stable/10@r272459 to releng/10.1 as part of
the 10.1-RELEASE process.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


# 205108 12-Mar-2010 delphij

Correct bugs fixed but not merged from my own tree.

Pointy hat to: delphij
MFC after: 1 month


# 205100 12-Mar-2010 delphij

Follow up commit to reindent the code.

MFC after: 1 month


# 205099 12-Mar-2010 delphij

Two optimizations to MI strlen(3) inspired by David S. Miller's
blog posting [1].

- Use word-sized test for unaligned pointer before working
the hard way.

Memory page boundary is always integral multiple of a word
alignment boundary. Therefore, if we can access memory
referenced by pointer p, then (p & ~word mask) must be also
accessible.

- Better utilization of multi-issue processor's ability of
concurrency.

The previous implementation utilized a formular that must be
executed sequentially. However, the ~, & and - operations can
actually be caculated at the same time when the operand were
different and unrelated.

The original Hacker's Delight formular also offered consistent
performance regardless whether the input would contain
characters with their highest-bit set, as it catches real
nul characters only.

These two optimizations has shown further improvements over the
previous implementation on microbenchmarks on i386 and amd64 CPU
including Pentium 4, Core Duo 2 and i7.

[1] http://vger.kernel.org/~davem/cgi-bin/blog.cgi/2010/03/08#strlen_1

MFC after: 1 month


# 187707 26-Jan-2009 delphij

- Fix grammar. [1]
- Use the correct term 'long mode'. [2]
- style(9) for return value. [3]

Submitted by: Ben Kaduk <minimarmot gmail com> [1],
obrien [2], scf [3]


# 187700 25-Jan-2009 delphij

Rewrite of MI strlen(3) in a way that can better utilize modern hardware by
reducing branches and doing word-sized operation.

The idea is taken from J.T. Conklin's x86_64 optimized version of strlen(3)
for NetBSD, and reimplemented in C by me.

Discussed on: -arch@


# 165903 08-Jan-2007 imp

Per Regents of the University of Calfornia letter, remove advertising
clause.

# If I've done so improperly on a file, please let me know.


# 92889 21-Mar-2002 obrien

Remove 'register' keyword.


# 86170 07-Nov-2001 obrien

rcsid[]->__FBSDID


# 77117 24-May-2001 obrien

Make the rcsid and FreeBSD IDs more sane in the wcs* and wmem* files.
Do the same for the non-wcs*/wmem* files while I'm here.


# 1574 27-May-1994 rgrimes

This commit was generated by cvs2svn to compensate for changes in r1573,
which included commits to RCS files with non-trunk default branches.


# 1573 27-May-1994 rgrimes

BSD 4.4 Lite Lib Sources