void change_user(const char *user);
-/*
- * memcpy() optimization - improves hash.c.
- *
- * GCC can optimize fixed-length memcpys but not variable-length ones.
- * For short variable-length memcpys its faster to do dumb inlined copy
- * than call out to libc.
- */
-
-#if defined(__GNUC__) && (__GNUC__ >= 3)
-
-static inline void *_inline_memcpy(void *dst_, const void *src_, size_t len)
-{
- const uint8_t *src = src_;
- uint8_t *dst = dst_;
- while (len--)
- *dst++ = *src++;
- return dst_;
-}
-
-static inline void *_own_memcpy(void *dst, const void *src, size_t len)
-{
- if (!__builtin_constant_p(len)
- && __builtin_constant_p(len < 16)
- && len < 16)
- return _inline_memcpy(dst, src, len);
- else
- return memcpy(dst, src, len);
-}
-
-#undef memcpy
-#define memcpy(d, s, n) _own_memcpy(d, s, n)
-
-#endif
-
-/*
- * strcmp() optimization - compare first char inline.
- */
-
-static inline int _inline_strcmp(const char *a, const char *b)
-{
- if ((*a - *b) != 0)
- return (*a - *b);
- return strcmp(a, b);
-}
-
-#undef strcmp
-#define strcmp(a, b) _inline_strcmp(a, b)
c ^= b; c -= rot(b,24); \
} while (0)
+/*
+ * GCC does not know how to optimize short variable-length copies.
+ * Its faster to do dumb inlined copy than call out to libc.
+ */
+static inline void simple_memcpy(void *dst_, const void *src_, size_t len)
+{
+ const uint8_t *src = src_;
+ uint8_t *dst = dst_;
+ while (len--)
+ *dst++ = *src++;
+}
+
/* short version - let compiler worry about memory access */
uint32_t lookup3_hash(const void *data, size_t len)
{
}
buf[0] = buf[1] = buf[2] = 0;
- memcpy(buf, p, len);
+ simple_memcpy(buf, p, len);
a += buf[0];
b += buf[1];
c += buf[2];