55 #ifndef XXH_FORCE_MEMORY_ACCESS
56 # if defined(__GNUC__) && ( defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) \
57 || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) \
58 || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_6T2__) )
59 # define XXH_FORCE_MEMORY_ACCESS 2
60 # elif (defined(__INTEL_COMPILER) && !defined(_WIN32)) || \
61 (defined(__GNUC__) && ( defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) \
62 || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) \
63 || defined(__ARM_ARCH_7S__) ))
64 # define XXH_FORCE_MEMORY_ACCESS 1
73 #ifndef XXH_ACCEPT_NULL_INPUT_POINTER
74 # define XXH_ACCEPT_NULL_INPUT_POINTER 0
85 #ifndef XXH_FORCE_NATIVE_FORMAT
86 # define XXH_FORCE_NATIVE_FORMAT 0
96 #ifndef XXH_FORCE_ALIGN_CHECK
97 # if defined(__i386) || defined(_M_IX86) || defined(__x86_64__) || defined(_M_X64)
98 # define XXH_FORCE_ALIGN_CHECK 0
100 # define XXH_FORCE_ALIGN_CHECK 1
119 #define XXH_STATIC_LINKING_ONLY
127 # pragma warning(disable : 4127)
128 # define FORCE_INLINE static __forceinline
130 # if defined (__cplusplus) || defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
132 # define FORCE_INLINE static inline __attribute__((always_inline))
134 # define FORCE_INLINE static inline
137 # define FORCE_INLINE static
146 # if !defined (__VMS) \
147 && (defined (__cplusplus) \
148 || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) ) )
155 typedef unsigned short U16;
160 #if (defined(XXH_FORCE_MEMORY_ACCESS) && (XXH_FORCE_MEMORY_ACCESS==2))
165 #elif (defined(XXH_FORCE_MEMORY_ACCESS) && (XXH_FORCE_MEMORY_ACCESS==1))
170 static U32 XXH_read32(
const void* ptr) {
return ((
const unalign*)ptr)->u32; }
190 #define XXH_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
193 #if defined(_MSC_VER)
194 # define XXH_rotl32(x,r) _rotl(x,r)
195 # define XXH_rotl64(x,r) _rotl64(x,r)
197 # define XXH_rotl32(x,r) ((x << r) | (x >> (32 - r)))
198 # define XXH_rotl64(x,r) ((x << r) | (x >> (64 - r)))
201 #if defined(_MSC_VER)
202 # define XXH_swap32 _byteswap_ulong
203 #elif XXH_GCC_VERSION >= 403
204 # define XXH_swap32 __builtin_bswap32
208 return ((
x << 24) & 0xff000000 ) |
209 ((
x << 8) & 0x00ff0000 ) |
210 ((
x >> 8) & 0x0000ff00 ) |
211 ((
x >> 24) & 0x000000ff );
222 #ifndef XXH_CPU_LITTLE_ENDIAN
225 const union {
U32 u;
BYTE c[4]; } one = { 1 };
228 # define XXH_CPU_LITTLE_ENDIAN XXH_isLittleEndian()
259 #define XXH_STATIC_ASSERT(c) { enum { XXH_sa = 1/(int)(!!(c)) }; }
291 #define XXH_get32bits(p) XXH_readLE32_align(p, endian, align)
300 h32 += (*p) * PRIME32_5; \
302 h32 = XXH_rotl32(h32, 11) * PRIME32_1 ;
305 h32 += XXH_get32bits(p) * PRIME32_3; \
307 h32 = XXH_rotl32(h32, 17) * PRIME32_4 ;
362 #if defined(XXH_ACCEPT_NULL_INPUT_POINTER) && (XXH_ACCEPT_NULL_INPUT_POINTER>=1)
365 bEnd=
p=(
const BYTE*)(
size_t)16;
407 if ((((
size_t)
input) & 3) == 0) {
437 memcpy(dstState, srcState,
sizeof(*dstState));
461 #if defined(XXH_ACCEPT_NULL_INPUT_POINTER) && (XXH_ACCEPT_NULL_INPUT_POINTER>=1)
476 if (
state->memsize) {
533 if (
state->large_len) {
542 h32 +=
state->total_len_32;
580 #ifndef XXH_NO_LONG_LONG
590 # if !defined (__VMS) \
591 && (defined (__cplusplus) \
592 || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) ) )
597 typedef unsigned long long U64;
602 #if (defined(XXH_FORCE_MEMORY_ACCESS) && (XXH_FORCE_MEMORY_ACCESS==2))
607 #elif (defined(XXH_FORCE_MEMORY_ACCESS) && (XXH_FORCE_MEMORY_ACCESS==1))
612 static U64 XXH_read64(
const void* ptr) {
return ((
const unalign64*)ptr)->u64; }
629 #if defined(_MSC_VER)
630 # define XXH_swap64 _byteswap_uint64
631 #elif XXH_GCC_VERSION >= 403
632 # define XXH_swap64 __builtin_bswap64
636 return ((
x << 56) & 0xff00000000000000ULL) |
637 ((
x << 40) & 0x00ff000000000000ULL) |
638 ((
x << 24) & 0x0000ff0000000000ULL) |
639 ((
x << 8) & 0x000000ff00000000ULL) |
640 ((
x >> 8) & 0x00000000ff000000ULL) |
641 ((
x >> 24) & 0x0000000000ff0000ULL) |
642 ((
x >> 40) & 0x000000000000ff00ULL) |
643 ((
x >> 56) & 0x00000000000000ffULL);
701 #define XXH_get64bits(p) XXH_readLE64_align(p, endian, align)
709 #define PROCESS1_64 \
710 h64 ^= (*p) * PRIME64_5; \
712 h64 = XXH_rotl64(h64, 11) * PRIME64_1;
714 #define PROCESS4_64 \
715 h64 ^= (U64)(XXH_get32bits(p)) * PRIME64_1; \
717 h64 = XXH_rotl64(h64, 23) * PRIME64_2 + PRIME64_3;
719 #define PROCESS8_64 { \
720 U64 const k1 = XXH64_round(0, XXH_get64bits(p)); \
723 h64 = XXH_rotl64(h64,27) * PRIME64_1 + PRIME64_4; \
821 #if defined(XXH_ACCEPT_NULL_INPUT_POINTER) && (XXH_ACCEPT_NULL_INPUT_POINTER>=1)
824 bEnd=
p=(
const BYTE*)(
size_t)32;
870 if ((((
size_t)
input) & 7)==0) {
898 memcpy(dstState, srcState,
sizeof(*dstState));
921 #if defined(XXH_ACCEPT_NULL_INPUT_POINTER) && (XXH_ACCEPT_NULL_INPUT_POINTER>=1)
935 if (
state->memsize) {
987 if (
state->total_len >= 32) {
RZ_API void Ht_() free(HtName_(Ht) *ht)
return memset(p, 0, total)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
void * malloc(size_t size)
static void struct sockaddr socklen_t static fromlen static backlog static fork char char char static envp int struct rusage static rusage struct utsname static buf struct sembuf unsigned
XXH_PUBLIC_API unsigned int XXH32_digest(const XXH32_state_t *state_in)
FORCE_INLINE U32 XXH32_digest_endian(const XXH32_state_t *state, XXH_endianess endian)
FORCE_INLINE U32 XXH32_endian_align(const void *input, size_t len, U32 seed, XXH_endianess endian, XXH_alignment align)
XXH_PUBLIC_API XXH32_hash_t XXH32_hashFromCanonical(const XXH32_canonical_t *src)
XXH_PUBLIC_API XXH32_state_t * XXH32_createState(void)
FORCE_INLINE U64 XXH_readLE64(const void *ptr, XXH_endianess endian)
XXH_PUBLIC_API unsigned int XXH32(const void *input, size_t len, unsigned int seed)
XXH_PUBLIC_API XXH_errorcode XXH64_update(XXH64_state_t *state_in, const void *input, size_t len)
FORCE_INLINE U64 XXH_readLE64_align(const void *ptr, XXH_endianess endian, XXH_alignment align)
XXH_PUBLIC_API void XXH32_copyState(XXH32_state_t *dstState, const XXH32_state_t *srcState)
XXH_PUBLIC_API XXH_errorcode XXH32_reset(XXH32_state_t *statePtr, unsigned int seed)
FORCE_INLINE U32 XXH_readLE32(const void *ptr, XXH_endianess endian)
XXH_PUBLIC_API XXH_errorcode XXH64_reset(XXH64_state_t *statePtr, unsigned long long seed)
FORCE_INLINE U64 XXH64_digest_endian(const XXH64_state_t *state, XXH_endianess endian)
FORCE_INLINE XXH_errorcode XXH32_update_endian(XXH32_state_t *state, const void *input, size_t len, XXH_endianess endian)
XXH_PUBLIC_API XXH64_state_t * XXH64_createState(void)
FORCE_INLINE U32 XXH_readLE32_align(const void *ptr, XXH_endianess endian, XXH_alignment align)
XXH_PUBLIC_API XXH_errorcode XXH32_freeState(XXH32_state_t *statePtr)
XXH_PUBLIC_API unsigned long long XXH64(const void *input, size_t len, unsigned long long seed)
XXH_PUBLIC_API XXH64_hash_t XXH64_hashFromCanonical(const XXH64_canonical_t *src)
XXH_PUBLIC_API void XXH32_canonicalFromHash(XXH32_canonical_t *dst, XXH32_hash_t hash)
XXH_PUBLIC_API unsigned long long XXH64_digest(const XXH64_state_t *state_in)
XXH_PUBLIC_API XXH_errorcode XXH64_freeState(XXH64_state_t *statePtr)
FORCE_INLINE XXH_errorcode XXH64_update_endian(XXH64_state_t *state, const void *input, size_t len, XXH_endianess endian)
FORCE_INLINE U64 XXH64_endian_align(const void *input, size_t len, U64 seed, XXH_endianess endian, XXH_alignment align)
XXH_PUBLIC_API void XXH64_canonicalFromHash(XXH64_canonical_t *dst, XXH64_hash_t hash)
XXH_PUBLIC_API unsigned XXH_versionNumber(void)
XXH_PUBLIC_API XXH_errorcode XXH32_update(XXH32_state_t *state_in, const void *input, size_t len)
XXH_PUBLIC_API void XXH64_copyState(XXH64_state_t *dstState, const XXH64_state_t *srcState)
struct XXH32_state_s XXH32_state_t
struct XXH64_state_s XXH64_state_t
unsigned long long XXH64_hash_t
unsigned int XXH32_hash_t
#define XXH_VERSION_NUMBER
assert(limit<=UINT32_MAX/2)
static uint32_t const uint8_t uint32_t uint32_t limit
static U64 XXH_read64(const void *memPtr)
static U64 XXH64_finalize(U64 h64, const void *ptr, size_t len, XXH_endianess endian, XXH_alignment align)
static const U64 PRIME64_5
static U64 XXH64_mergeRound(U64 acc, U64 val)
#define XXH_STATIC_ASSERT(c)
static const U32 PRIME32_5
#define XXH_CPU_LITTLE_ENDIAN
static const U64 PRIME64_2
static void * XXH_malloc(size_t s)
static U32 XXH32_round(U32 seed, U32 input)
static const U32 PRIME32_1
static const U64 PRIME64_4
static U64 XXH64_avalanche(U64 h64)
static U64 XXH_swap64(U64 x)
static void XXH_free(void *p)
static U32 XXH_swap32(U32 x)
static const U64 PRIME64_1
static const U32 PRIME32_2
static U64 XXH_readBE64(const void *ptr)
static const U64 PRIME64_3
static const U32 PRIME32_3
static int XXH_isLittleEndian(void)
static const U32 PRIME32_4
static U32 XXH_read32(const void *memPtr)
static U64 XXH64_round(U64 acc, U64 input)
static U32 XXH_readBE32(const void *ptr)
#define XXH_FORCE_ALIGN_CHECK
static U32 XXH32_avalanche(U32 h32)
static void * XXH_memcpy(void *dest, const void *src, size_t size)
static U32 XXH32_finalize(U32 h32, const void *ptr, size_t len, XXH_endianess endian, XXH_alignment align)
#define XXH_FORCE_NATIVE_FORMAT
static bool input(void *ud, zip_uint8_t *data, zip_uint64_t length)