[Message Deleted]
-
why on hell are you modifying a function of the C runtime ??? :wtf: if your compilation fails, it's because of your code, not the sources provided with the compiler (even if the compiler reported the error in memcpy()) :doh:
[VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]
-
why on hell are you modifying a function of the C runtime ??? :wtf: if your compilation fails, it's because of your code, not the sources provided with the compiler (even if the compiler reported the error in memcpy()) :doh:
[VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]
-
There's absolutely no reason to post this twice.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001 -
No No this is a question I have to answer, I am just checking to make sure the function code show doesnt cause cause any problems and it is efficient code.
You delete your question!?
WhiteSky
-
You delete your question!?
WhiteSky
Yeah they said that I didnt need to post it twice but the question basically was: What is wrong or how can I improve this function: void* memcpy( void* dest, void* src, size_t size ) { byte* pTo = (byte*)dest; byte* pFrom = (byte*)src; assert( dest != NULL && src != NULL ); while( size-- > 0 ) *pTo++ = *pFrom++; return (dest); }
-
Yeah they said that I didnt need to post it twice but the question basically was: What is wrong or how can I improve this function: void* memcpy( void* dest, void* src, size_t size ) { byte* pTo = (byte*)dest; byte* pFrom = (byte*)src; assert( dest != NULL && src != NULL ); while( size-- > 0 ) *pTo++ = *pFrom++; return (dest); }
Hi Josh, You're copying a byte at a time... it is not as efficient as it could be on architectures such as x86 which has SIMD instructions. Jeff