Re: strchrnul speed

2008-04-29 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Bruno Haible on 4/28/2008 4:06 PM: | Why should a developer who uses gnulib have to write valgrind suppression files | to work around ISO C99 violations in gnulib? We can at least provide a | strchrnul.valgrind file, like the 'malloca' mo

Re: strchrnul speed

2008-04-29 Thread Bruno Haible
Eric Blake wrote: > 2008-04-28 Eric Blake <[EMAIL PROTECTED]> > > + Add rawmemchr module, matching glibc. > + * modules/string (Makefile.am): New indicator. > + * m4/string_h.m4 (gl_HEADER_STRING_H_DEFAULTS): Set it. > + * lib/string.in.h (rawmemchr): Declare when appropriate.

rawmemchr [was: strchrnul speed]

2008-04-28 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Eric Blake on 4/28/2008 5:20 PM: | Eric Blake byu.net> writes: | |> Meanwhile, adding rawmemchr would speed up the (corner) case of |> strchrnul(s,0), but I haven't tackled that yet. | | Here it is, plus another potential C99 read-beyond

Re: strchrnul speed

2008-04-28 Thread Eric Blake
Eric Blake byu.net> writes: > Meanwhile, adding rawmemchr would speed up the (corner) case of > strchrnul(s,0), but I haven't tackled that yet. Here it is, plus another potential C99 read-beyond-end violation. I'll follow Bruno's advice and add .valgrind files for strchrnul and rawmemchr next,

Re: strchrnul speed

2008-04-28 Thread Bruno Haible
Ben Pfaff wrote: > This approach will cause false-positive warnings under memory > debuggers such as Valgrind. Good point. > However, anyone who notices such a > warning should be able to spot from the comments in the function > that it is still correct code given the assumption you have > above,

Re: strchrnul speed

2008-04-28 Thread Eric Blake
Ben Pfaff cs.stanford.edu> writes: > > Any objections against this patch? I ask because it intentionally > > violates the C99 constraint of not reading beyond the end of an array. > > However, the excess read can only occur on the final longword of an array, > > and only with an aligned longword

Re: strchrnul speed

2008-04-28 Thread Ben Pfaff
Eric Blake <[EMAIL PROTECTED]> writes: > Any objections against this patch? I ask because it intentionally > violates the C99 constraint of not reading beyond the end of an array. > However, the excess read can only occur on the final longword of an array, > and only with an aligned longword read

Re: strchrnul speed

2008-04-28 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Eric Blake on 4/23/2008 3:24 PM: | Also, is anyone interested in making gnulib's memchr and strchrnul more | efficient by copying the optimizations learned in memchr2? Also, should we | provide a replacement for glibc's rawmemchr (surpri