musl's strlen() is a work of art except for the hopefully-harmless UB http://git.musl-libc.org/cgit/musl/tree/src/string/strlen.c …
-
-
Replying to @johnregehr
@johnregehr just the read past the end or something else I don't see?2 replies 0 retweets 0 likes -
Replying to @whitequark
@whitequark yep, reads past the end-- probably not a big deal2 replies 0 retweets 0 likes -
Replying to @johnregehr
@johnregehr can you even implement fast strlen() without UB?2 replies 0 retweets 0 likes -
Replying to @whitequark
@whitequark I can't see any way to do it w/o padding all strings1 reply 0 retweets 0 likes -
Replying to @johnregehr
@johnregehr@whitequark either write asm, or write the naive loop and depend on a Smart Compiler.1 reply 0 retweets 1 like -
Replying to @stephentyrone
@johnregehr@whitequark (significantly less compiler smarts required for the naive loop than this clever implementation, BTW).1 reply 0 retweets 1 like -
Replying to @stephentyrone
@stephentyrone@johnregehr there's something incestous in compiler recognizing this idiom and replacing it with optimized SIMD2 replies 1 retweet 2 likes -
Replying to @whitequark
@whitequark@stephentyrone@johnregehr I'd love it if compilers would vectorize str ops w/GP regs instead of needing SIMD but they won't. :(2 replies 0 retweets 0 likes
@whitequark @stephentyrone @johnregehr I'm not overly committed to maintaining perf. on outdated compilers if new compilers add that, tho.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.