36 #define copymem(m_to,m_from,m_count) \ 38 unsigned char * _from=(unsigned char*)m_from; \ 39 unsigned char * _to=(unsigned char*)m_to; \ 41 for (int _i=0;_i<_count;_i++) \ 54 #define movemem_duff(m_to, m_from, m_count) \ 57 unsigned char* _dto = (unsigned char*)m_to; \ 58 unsigned char* _dfrom = (unsigned char*)m_from; \ 59 int n = (m_count + 7) / 8; \ 60 switch (m_count % 8) { \ 62 case 0: *_dto++ = *_dfrom++; \ 63 case 7: *_dto++ = *_dfrom++; \ 64 case 6: *_dto++ = *_dfrom++; \ 65 case 5: *_dto++ = *_dfrom++; \ 66 case 4: *_dto++ = *_dfrom++; \ 67 case 3: *_dto++ = *_dfrom++; \ 68 case 2: *_dto++ = *_dfrom++; \ 69 case 1: *_dto++ = *_dfrom++; \ 72 } else if (m_to>m_from) { \ 73 unsigned char* _dto = &((unsigned char*)m_to)[m_count-1]; \ 74 unsigned char* _dfrom = &((unsigned char*)m_from)[m_count-1]; \ 75 int n = (m_count + 7) / 8; \ 76 switch (m_count % 8) { \ 78 case 0: *_dto-- = *_dfrom--; \ 79 case 7: *_dto-- = *_dfrom--; \ 80 case 6: *_dto-- = *_dfrom--; \ 81 case 5: *_dto-- = *_dfrom--; \ 82 case 4: *_dto-- = *_dfrom--; \ 83 case 3: *_dto-- = *_dfrom--; \ 84 case 2: *_dto-- = *_dfrom--; \ 85 case 1: *_dto-- = *_dfrom--; \ 91 #define movemem_conventional(m_to,m_from,m_count) \ 94 unsigned char * _from=(unsigned char*)m_from; \ 95 unsigned char * _to=(unsigned char*)m_to; \ 97 for (int _i=0;_i<_count;_i++) \ 100 } else if (m_to>m_from) { \ 101 unsigned char * _from=(unsigned char*)m_from; \ 102 unsigned char * _to=(unsigned char*)m_to; \ 103 int _count=m_count; \ 105 _to[_count]=_from[_count]; \ 111 void movemem_system(
void*,
void*,
int);
113 #define movemem movemem_system 116 void zeromem(
void* p_mem,
size_t p_bytes);