is strlen()'s read-4-bytes-ahead a standard?

Xin LI delphij at delphij.net
Thu Jul 15 22:44:09 UTC 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 2010/07/15 15:38, deeptech71 at gmail.com wrote:
> Some C implementations use the read-4-bytes-ahead technique to speed
> up strlen(). Does the C standard state anything about strlen() being
> allowed to read past the terminating zero?

It's not 4-bytes-ahead, but read a whole (aligned) word at one time.

I think C standard does not dictate in this detail.

But why?

Cheers,
- -- 
Xin LI <delphij at delphij.net>	http://www.delphij.net/
FreeBSD - The Power to Serve!	       Live free or die
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (FreeBSD)

iQEcBAEBCAAGBQJMP48tAAoJEATO+BI/yjfBBNwIAJrqtefoZJ90095Aurk5H9kv
SQZ8wVO1vgFu4qN2yT8InuXtpCB9Q6onuFQmMphdQrbqJWIDb+lxCD8UZUp6ocZE
544RPI9kLwWfUwQ0WdrTNmdAHGIbqc6nrhlS3IwTn82NCjuFH5pEpUmt0r53b19I
jy/FlJjjTSiSC32tODLa922mo1GB50CA3fFlgUVlB7PHLRvdLeE6JsmvRA89gfRi
/TOIRP8X/tJeDE4yuDycRmMCvOI+hFHdFchMxYQG2bifo1aZQzny+iNRA0xvYpO7
oZble3Cgwfs+jj2RkGW/syOXtvYA1CTxAJ67vf4OCX5Facq+Yfi3pto7xbIJCKE=
=rxAG
-----END PGP SIGNATURE-----


More information about the freebsd-chat mailing list