My memcmp:
memcmp( *buf1, *buf2, unsigned (count && !(reval = (*(unsigned *)buf1) - (*(unsigned * buf1 = (unsigned *)buf1 + buf2 = (unsigned *)buf2 + -- }
VC MS:
* * (!( ( --count && *( *)buf1 == *( *= ( *)buf1 + = ( *)buf2 + ( *((unsigned *)buf1) - *((unsigned *
The const void * buf should be used properly, and the contents of the block memory should not be changed. Finally, the unsigned char * should be used for calculation to ensure that the symbols of the calculation result are correct.
My memcpy:
*memcpy( *dest, *src, unsigned *reval = (count-- (*(unsigned *)dest++) = (*(unsigned *)src++ }
MSVC:
* * * * ret = defined (_M_MRX000) || defined (_M_ALPHA) || defined (_M_PPC) RtlMoveMemory( *, * /* defined (_M_MRX000) || defined (_M_ALPHA) || defined (_M_PPC) */ (count-- *( *)dst = *( * dst = ( *)dst + src = ( *)src + /* defined (_M_MRX000) || defined (_M_ALPHA) || defined (_M_PPC) */ }
My memmove:
*memmove( *dest, *src, unsigned *reval = overlap = ((unsigned *)src < (unsigned *)dest && ((unsigned *)src + count) > (count-- (overlap) (*((unsigned *)dest + count)) = (*((unsigned *)src + count (*(unsigned *)dest++) = (*(unsigned *)src++ }
MSVC:
* * * * ret = defined (_M_MRX000) || defined (_M_ALPHA) || defined (_M_PPC) RtlMoveMemory( *, * /* defined (_M_MRX000) || defined (_M_ALPHA) || defined (_M_PPC) */ (dst <= src || ( *)dst >= (( *)src + (count-- *( *)dst = *( * dst = ( *)dst + src = ( *)src + dst = ( *)dst + count - src = ( *)src + count - (count-- *( *)dst = *( * dst = ( *)dst - src = ( *)src - /* defined (_M_MRX000) || defined (_M_ALPHA) || defined (_M_PPC) */ }
Regarding the differences between memcpy and memmove, memcpy does not consider the overlap of memory areas, while memmove ensures that memory areas overlap and replication can be successful.
Sometimes our memcpy may be used normally when the memory overlaps. This depends on its implementation and is not universal. This is not required in the C language standard.
References:
Differences between memcpy and memmove Functions
Http://blog.csdn.net/caowei840701/article/details/8491836
Memcpy () vs memmove ()
Http://stackoverflow.com/questions/4415910/memcpy-vs-memmove
My memset:
*memset( *buffer, c, *reval = (count-- (*(unsigned *)buffer++) = (unsigned }
MSVC:
* * *start = defined (_M_MRX000) || defined (_M_ALPHA) || defined (_M_PPC) RtlFillMemory( *, size_t count, RtlFillMemory( dst, count, ( /* defined (_M_MRX000) || defined (_M_ALPHA) || defined (_M_PPC) */ (count-- *( *)dst = ( dst = ( *)dst + /* defined (_M_MRX000) || defined (_M_ALPHA) || defined (_M_PPC) */ }
End