I read the article Optimizing Memcpy improves speed, I have a question about the modified-GNU algorithm, I get an error running the code the src & 0xFFFFFFFC , src is a void pointer, can it be a left operand for ‘&’ ? Did I miss anything here?
Thanks
Error 1 error C2296: '&' : illegal, left operand has type 'const void *’
void * memcpy(void * dst, void const * src, size_t len)
{
long * plDst = (long *) dst;
long const * plSrc = (long const *) src;
if (!(src & 0xFFFFFFFC) && !(dst & 0xFFFFFFFC))
{
while (len >= 4)
{
*plDst++ = *plSrc++;
len -= 4;
}
}
char * pcDst = (char *) plDst;
char const * pcSrc = (char const *) plSrc;
len += 4;
while (len--)
{
*pcDst++ = *pcSrc++;
}
return (dst);
}