Switch between memcpy implementations according to src/dest alignment.

This commit is contained in:
Keith Whitwell 2006-02-01 18:42:16 +00:00
parent 6a13b6c346
commit 11c0215bf8

View file

@ -57,6 +57,15 @@ static void intelFreeTextureImageData( GLcontext *ctx,
}
}
static void *do_memcpy( void *dest, const void *src, size_t n )
{
if ( (((unsigned)src) & 63) ||
(((unsigned)dest) & 63))
return __memcpy(dest, src, n);
else
return memcpy(dest, src, n);
}
void intelInitTextureFuncs(struct dd_function_table * functions)
{
@ -88,5 +97,5 @@ void intelInitTextureFuncs(struct dd_function_table * functions)
*
* TODO: switch dynamically.
*/
functions->TextureMemCpy = __memcpy;
functions->TextureMemCpy = do_memcpy;
}