"Richard L. Hamilton" <rlha...@smart.net> wrote: > Right - I can't see it mattering either except when accessing > memory-mapped hardware (that had control registers rather than actual > memory like say video memory), which I have difficulty imagining it being > useful to use memchr() against anyway. In fact, if memory accesses > all actually take place in terms of whole words (given the bus width, > and with any unwanted portion perhaps just tossed), I'm not sure it > would be detectably different even then.
See the example I did give in a previous mail. > As I recall, it was intentional to use memchr() precisely because it would > give strnlen() the benefit of the optimizations already applied to memchr(), > without creating more assembler code to maintain. > > And to top it all off, I just found an email from Jörg dated 5 October 2006 > _recommending_ the use of memchr() to implement strnlen(). :-) Nobody is free of mistakes, but I would guess that in 2006 (when strnlen() AFAIK was not yet part of the POSIX standard) I could not know that the later standard would disallow such optimizations. Jörg -- EMail:jo...@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin j...@cs.tu-berlin.de (uni) joerg.schill...@fokus.fraunhofer.de (work) Blog: http://schily.blogspot.com/ URL: http://cdrecord.berlios.de/private/ ftp://ftp.berlios.de/pub/schily _______________________________________________ opensolaris-code mailing list opensolaris-code@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/opensolaris-code