#ifndef ISL_HASH_H
#define ISL_HASH_H
+#include <stdlib.h>
#include <isl_stdint.h>
#if defined(__cplusplus)
(((h) >> (bits)) ^ (h)) & (((uint32_t)1 << (bits)) - 1)
uint32_t isl_hash_string(uint32_t hash, const char *s);
+uint32_t isl_hash_mem(uint32_t hash, const void *p, size_t len);
+
+#define isl_hash_builtin(h,l) isl_hash_mem(h, &l, sizeof(l))
struct isl_hash_table_entry
{
return hash;
}
+uint32_t isl_hash_mem(uint32_t hash, const void *p, size_t len)
+{
+ int i;
+ const char *s = p;
+ for (i = 0; i < len; ++i)
+ isl_hash_byte(hash, s[i]);
+ return hash;
+}
+
static unsigned int round_up(unsigned int v)
{
int old_v = v;