3 ms·
If that's too simple for you, you may have fun with the strlen implementation in glibc: https://sourceware.org/git/?p=glibc.git;a=blob_plain;f=string/strlen.c;
by f00zz 5y ago
If that's too simple for you, you may have fun with the strlen implementation in glibc:
https://sourceware.org/git/?p=glibc.git;a=blob_plain;f=string/strlen.c;hb=HEAD https://sourceware.org/git/?p=glibc.git;a=blob_plain;f=strin...
- saagarjha 5y agoThen look at the strlen that is probably running on your computer: https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/x86_64/strlen.S https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/x86...
- makach 5y agoExcellent reply! Thanks! ..and also thanks for pointing out the obvious *magic in the code!
- kevin_thibedeau 5y agoNeeds a static assert instead of abort().