From owner-freebsd-chat@FreeBSD.ORG Fri Jul 16 13:25:45 2010 Return-Path: Delivered-To: freebsd-chat@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D3D01065673 for ; Fri, 16 Jul 2010 13:25:45 +0000 (UTC) (envelope-from doconnor@gsoft.com.au) Received: from cain.gsoft.com.au (cain.gsoft.com.au [203.31.81.10]) by mx1.freebsd.org (Postfix) with ESMTP id A2D768FC19 for ; Fri, 16 Jul 2010 13:25:44 +0000 (UTC) Received: from ur.dons.net.au (ppp121-45-157-100.lns6.adl6.internode.on.net [121.45.157.100]) (authenticated bits=0) by cain.gsoft.com.au (8.14.4/8.14.3) with ESMTP id o6GDPYQ2045707 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Fri, 16 Jul 2010 22:55:40 +0930 (CST) (envelope-from doconnor@gsoft.com.au) Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii From: "Daniel O'Connor" In-Reply-To: <201007160927.o6G9RU34020754@lurza.secnetix.de> Date: Fri, 16 Jul 2010 22:55:33 +0930 Content-Transfer-Encoding: quoted-printable Message-Id: <1DE534FE-4BCB-4524-AB6C-7E758589A9CD@gsoft.com.au> References: <201007160927.o6G9RU34020754@lurza.secnetix.de> To: Oliver Fromme X-Mailer: Apple Mail (2.1081) X-Spam-Score: 0.163 () BAYES_00,RDNS_DYNAMIC X-Scanned-By: MIMEDefang 2.67 on 203.31.81.10 Cc: deeptech71@gmail.com, freebsd-chat@freebsd.org Subject: Re: is strlen()'s read-4-bytes-ahead a standard? X-BeenThere: freebsd-chat@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Non technical items related to the community List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jul 2010 13:25:45 -0000 On 16/07/2010, at 18:57, Oliver Fromme wrote: >> Just wondering. >=20 > There's no reason not to read the string as aligned words. > Because they're aligned, there's no risk to accidentally > hit the next VM page after the end of the string. Unless you're calling strlen on something that isn't memory (eg memory = mapped device). Although that would be dumb precisely because you don't know how it's = implemented. Also the compiler would warn you because your mmap'd device pointer = should be declared volatile anyway.. -- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C