Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Jul 2010 15:43:58 -0700
From:      Xin LI <delphij@delphij.net>
To:        "deeptech71@gmail.com" <deeptech71@gmail.com>
Cc:        freebsd-chat@freebsd.org
Subject:   Re: is strlen()'s read-4-bytes-ahead a standard?
Message-ID:  <4C3F8F2E.9080705@delphij.net>
In-Reply-To: <AANLkTima5e5pXRrLkOP-3vzHrXWawhDOyP25xgHBPqw_@mail.gmail.com>
References:  <AANLkTima5e5pXRrLkOP-3vzHrXWawhDOyP25xgHBPqw_@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 2010/07/15 15:38, deeptech71@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@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-----



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4C3F8F2E.9080705>