From 163429f0357a53100700b4297b7b6239641f3a9e Mon Sep 17 00:00:00 2001 From: Stefan `Sec` Zehl Date: Fri, 27 Jan 2012 22:42:56 +0100 Subject: [PATCH] Make memcpy smaller. We don't need the speed :) --- firmware/core/libc/string.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/firmware/core/libc/string.c b/firmware/core/libc/string.c index 3fe0b9c..e6bb0fe 100644 --- a/firmware/core/libc/string.c +++ b/firmware/core/libc/string.c @@ -52,6 +52,7 @@ void * memcpy(void *pDestination, const void *pSource, size_t num) { unsigned char *pByteDestination; unsigned char *pByteSource; +#ifdef FAST_MEMCPY unsigned int *pAlignedSource = (unsigned int *) pSource; unsigned int *pAlignedDestination = (unsigned int *) pDestination; @@ -71,6 +72,10 @@ void * memcpy(void *pDestination, const void *pSource, size_t num) // Copy remaining bytes pByteDestination = (unsigned char *) pAlignedDestination; pByteSource = (unsigned char *) pAlignedSource; +#else + pByteDestination = (unsigned char *) pDestination; + pByteSource = (unsigned char *) pSource; +#endif while (num--) { *pByteDestination++ = *pByteSource++;