Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Jul 2010 09:41:23 +0200
From:      "deeptech71@gmail.com" <deeptech71@gmail.com>
To:        freebsd-chat@freebsd.org
Subject:   Re: is strlen()'s read-4-bytes-ahead a standard?
Message-ID:  <AANLkTim9ULyOAPigkpxLC_5Lrs1fN6abkYN1DDmTxSvz@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Xin LI wrote:
> 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.

OK, can anyone confirm this?

> But why?

Just wondering.



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