52 #ifndef XXH_FORCE_MEMORY_ACCESS
53 # if defined(__GNUC__) && ( defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) \
54 || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) \
55 || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_6T2__) )
56 # define XXH_FORCE_MEMORY_ACCESS 2
57 # elif (defined(__INTEL_COMPILER) && !defined(_WIN32)) || \
58 (defined(__GNUC__) && ( defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) \
59 || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) \
60 || defined(__ARM_ARCH_7S__) ))
61 # define XXH_FORCE_MEMORY_ACCESS 1
70 #ifndef XXH_ACCEPT_NULL_INPUT_POINTER
71 # define XXH_ACCEPT_NULL_INPUT_POINTER 0
82 #ifndef XXH_FORCE_NATIVE_FORMAT
83 # define XXH_FORCE_NATIVE_FORMAT 0
93 #ifndef XXH_FORCE_ALIGN_CHECK
94 # if defined(__i386) || defined(_M_IX86) || defined(__x86_64__) || defined(_M_X64)
95 # define XXH_FORCE_ALIGN_CHECK 0
97 # define XXH_FORCE_ALIGN_CHECK 1
116 #define XXH_STATIC_LINKING_ONLY
124 # pragma warning(disable : 4127)
125 # define FORCE_INLINE static __forceinline
127 # if defined (__cplusplus) || defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
129 # define FORCE_INLINE static inline __attribute__((always_inline))
131 # define FORCE_INLINE static inline
134 # define FORCE_INLINE static
143 # if !defined (__VMS) \
144 && (defined (__cplusplus) \
145 || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) ) )
152 typedef unsigned short U16;
157 #if (defined(XXH_FORCE_MEMORY_ACCESS) && (XXH_FORCE_MEMORY_ACCESS==2))
162 #elif (defined(XXH_FORCE_MEMORY_ACCESS) && (XXH_FORCE_MEMORY_ACCESS==1))
167 static U32 XXH_read32(
const void* ptr) {
return ((
const unalign*)ptr)->u32; }
187 #define XXH_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
190 #if defined(_MSC_VER)
191 # define XXH_rotl32(x,r) _rotl(x,r)
192 # define XXH_rotl64(x,r) _rotl64(x,r)
194 # define XXH_rotl32(x,r) ((x << r) | (x >> (32 - r)))
195 # define XXH_rotl64(x,r) ((x << r) | (x >> (64 - r)))
198 #if defined(_MSC_VER)
199 # define XXH_swap32 _byteswap_ulong
200 #elif XXH_GCC_VERSION >= 403
201 # define XXH_swap32 __builtin_bswap32
205 return ((
x << 24) & 0xff000000 ) |
206 ((
x << 8) & 0x00ff0000 ) |
207 ((
x >> 8) & 0x0000ff00 ) |
208 ((
x >> 24) & 0x000000ff );
219 #ifndef XXH_CPU_LITTLE_ENDIAN
222 const union {
U32 u;
BYTE c[4]; } one = { 1 };
225 # define XXH_CPU_LITTLE_ENDIAN XXH_isLittleEndian()
256 #define XXH_STATIC_ASSERT(c) { enum { XXH_sa = 1/(int)(!!(c)) }; }
288 #define XXH_get32bits(p) XXH_readLE32_align(p, endian, align)
298 h32 += (*p++) * PRIME32_5; \
299 h32 = XXH_rotl32(h32, 11) * PRIME32_1 ;
302 h32 += XXH_get32bits(p) * PRIME32_3; \
304 h32 = XXH_rotl32(h32, 17) * PRIME32_4 ;
359 #if defined(XXH_ACCEPT_NULL_INPUT_POINTER) && (XXH_ACCEPT_NULL_INPUT_POINTER>=1)
362 bEnd=
p=(
const BYTE*)(
size_t)16;
404 if ((((
size_t)
input) & 3) == 0) {
434 memcpy(dstState, srcState,
sizeof(*dstState));
455 #if defined(XXH_ACCEPT_NULL_INPUT_POINTER) && (XXH_ACCEPT_NULL_INPUT_POINTER>=1)
473 if (
state->memsize) {
531 if (
state->large_len) {
540 h32 +=
state->total_len_32;
578 #ifndef XXH_NO_LONG_LONG
588 # if !defined (__VMS) \
589 && (defined (__cplusplus) \
590 || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) ) )
595 typedef unsigned long long U64;
600 #if (defined(XXH_FORCE_MEMORY_ACCESS) && (XXH_FORCE_MEMORY_ACCESS==2))
605 #elif (defined(XXH_FORCE_MEMORY_ACCESS) && (XXH_FORCE_MEMORY_ACCESS==1))
610 static U64 XXH_read64(
const void* ptr) {
return ((
const unalign64*)ptr)->u64; }
627 #if defined(_MSC_VER)
628 # define XXH_swap64 _byteswap_uint64
629 #elif XXH_GCC_VERSION >= 403
630 # define XXH_swap64 __builtin_bswap64
634 return ((
x << 56) & 0xff00000000000000ULL) |
635 ((
x << 40) & 0x00ff000000000000ULL) |
636 ((
x << 24) & 0x0000ff0000000000ULL) |
637 ((
x << 8) & 0x000000ff00000000ULL) |
638 ((
x >> 8) & 0x00000000ff000000ULL) |
639 ((
x >> 24) & 0x0000000000ff0000ULL) |
640 ((
x >> 40) & 0x000000000000ff00ULL) |
641 ((
x >> 56) & 0x00000000000000ffULL);
699 #define XXH_get64bits(p) XXH_readLE64_align(p, endian, align)
707 #define PROCESS1_64 \
708 h64 ^= (*p++) * PRIME64_5; \
709 h64 = XXH_rotl64(h64, 11) * PRIME64_1;
711 #define PROCESS4_64 \
712 h64 ^= (U64)(XXH_get32bits(p)) * PRIME64_1; \
714 h64 = XXH_rotl64(h64, 23) * PRIME64_2 + PRIME64_3;
716 #define PROCESS8_64 { \
717 U64 const k1 = XXH64_round(0, XXH_get64bits(p)); \
720 h64 = XXH_rotl64(h64,27) * PRIME64_1 + PRIME64_4; \
818 #if defined(XXH_ACCEPT_NULL_INPUT_POINTER) && (XXH_ACCEPT_NULL_INPUT_POINTER>=1)
821 bEnd=
p=(
const BYTE*)(
size_t)32;
867 if ((((
size_t)
input) & 7)==0) {
895 memcpy(dstState, srcState,
sizeof(*dstState));
915 #if defined(XXH_ACCEPT_NULL_INPUT_POINTER) && (XXH_ACCEPT_NULL_INPUT_POINTER>=1)
932 if (
state->memsize) {
985 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)
static U64 XXH_read64(const void *memPtr)
FORCE_INLINE U32 XXH32_digest_endian(const XXH32_state_t *state, XXH_endianess endian)
static U64 XXH64_finalize(U64 h64, const void *ptr, size_t len, XXH_endianess endian, XXH_alignment align)
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)
static const U64 PRIME64_5
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)
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
FORCE_INLINE U64 XXH_readLE64_align(const void *ptr, XXH_endianess endian, XXH_alignment align)
static void * XXH_malloc(size_t s)
XXH_PUBLIC_API void XXH32_copyState(XXH32_state_t *dstState, const XXH32_state_t *srcState)
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)
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)
static void XXH_free(void *p)
static U32 XXH_swap32(U32 x)
static const U64 PRIME64_1
static const U32 PRIME32_2
XXH_PUBLIC_API XXH_errorcode XXH64_reset(XXH64_state_t *statePtr, unsigned long long seed)
static U64 XXH_readBE64(const void *ptr)
static const U64 PRIME64_3
static const U32 PRIME32_3
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)
static int XXH_isLittleEndian(void)
static const U32 PRIME32_4
static U32 XXH_read32(const void *memPtr)
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)
static U64 XXH64_round(U64 acc, U64 input)
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)
static U32 XXH_readBE32(const void *ptr)
XXH_PUBLIC_API void XXH64_canonicalFromHash(XXH64_canonical_t *dst, XXH64_hash_t hash)
#define XXH_FORCE_ALIGN_CHECK
static U32 XXH32_avalanche(U32 h32)
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)
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)
XXH_PUBLIC_API void XXH64_copyState(XXH64_state_t *dstState, const XXH64_state_t *srcState)
#define XXH_FORCE_NATIVE_FORMAT
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 bool input(void *ud, zip_uint8_t *data, zip_uint64_t length)