Re: size_t problems
CBFalconer:
>
AFAICS this has the same action as strlen.
Just as an example, the strlen on Microsoft Windows compilers test
entire 4-byte chunks at a time looking for a byte which is all zeros.
It's a hell of a lot faster than using a canonical loop.
Martin
CBFalconer:
size_t Strlen(char *s) {
char *p = s;
if (p) while (*p) p++;
return p - s;
}
char *p = s;
if (p) while (*p) p++;
return p - s;
}
AFAICS this has the same action as strlen.
Just as an example, the strlen on Microsoft Windows compilers test
entire 4-byte chunks at a time looking for a byte which is all zeros.
It's a hell of a lot faster than using a canonical loop.
Martin
Comment