Deleted Added
full compact
73c73
< size_t hash1, hash2, bucket, cell;
---
> size_t hashes[2], bucket, cell;
77c77
< ckh->hash(key, ckh->lg_curbuckets, &hash1, &hash2);
---
> ckh->hash(key, hashes);
80c80
< bucket = hash1 & ((ZU(1) << ckh->lg_curbuckets) - 1);
---
> bucket = hashes[0] & ((ZU(1) << ckh->lg_curbuckets) - 1);
86c86
< bucket = hash2 & ((ZU(1) << ckh->lg_curbuckets) - 1);
---
> bucket = hashes[1] & ((ZU(1) << ckh->lg_curbuckets) - 1);
129c129
< size_t hash1, hash2, bucket, tbucket;
---
> size_t hashes[2], bucket, tbucket;
158,159c158,159
< ckh->hash(key, ckh->lg_curbuckets, &hash1, &hash2);
< tbucket = hash2 & ((ZU(1) << ckh->lg_curbuckets) - 1);
---
> ckh->hash(key, hashes);
> tbucket = hashes[1] & ((ZU(1) << ckh->lg_curbuckets) - 1);
161c161,162
< tbucket = hash1 & ((ZU(1) << ckh->lg_curbuckets) - 1);
---
> tbucket = hashes[0] & ((ZU(1) << ckh->lg_curbuckets)
> - 1);
195c196
< size_t hash1, hash2, bucket;
---
> size_t hashes[2], bucket;
199c200
< ckh->hash(key, ckh->lg_curbuckets, &hash1, &hash2);
---
> ckh->hash(key, hashes);
202c203
< bucket = hash1 & ((ZU(1) << ckh->lg_curbuckets) - 1);
---
> bucket = hashes[0] & ((ZU(1) << ckh->lg_curbuckets) - 1);
207c208
< bucket = hash2 & ((ZU(1) << ckh->lg_curbuckets) - 1);
---
> bucket = hashes[1] & ((ZU(1) << ckh->lg_curbuckets) - 1);
420,422c421,422
< #ifdef JEMALLOC_DEBUG
< memset(ckh, 0x5a, sizeof(ckh_t));
< #endif
---
> if (config_debug)
> memset(ckh, 0x5a, sizeof(ckh_t));
529c529
< ckh_string_hash(const void *key, unsigned minbits, size_t *hash1, size_t *hash2)
---
> ckh_string_hash(const void *key, size_t r_hash[2])
531,532d530
< size_t ret1, ret2;
< uint64_t h;
534,553c532
< assert(minbits <= 32 || (SIZEOF_PTR == 8 && minbits <= 64));
< assert(hash1 != NULL);
< assert(hash2 != NULL);
<
< h = hash(key, strlen((const char *)key), UINT64_C(0x94122f335b332aea));
< if (minbits <= 32) {
< /*
< * Avoid doing multiple hashes, since a single hash provides
< * enough bits.
< */
< ret1 = h & ZU(0xffffffffU);
< ret2 = h >> 32;
< } else {
< ret1 = h;
< ret2 = hash(key, strlen((const char *)key),
< UINT64_C(0x8432a476666bbc13));
< }
<
< *hash1 = ret1;
< *hash2 = ret2;
---
> hash(key, strlen((const char *)key), 0x94122f33U, r_hash);
567,568c546
< ckh_pointer_hash(const void *key, unsigned minbits, size_t *hash1,
< size_t *hash2)
---
> ckh_pointer_hash(const void *key, size_t r_hash[2])
570,571d547
< size_t ret1, ret2;
< uint64_t h;
574c550
< uint64_t i;
---
> size_t i;
577,580d552
< assert(minbits <= 32 || (SIZEOF_PTR == 8 && minbits <= 64));
< assert(hash1 != NULL);
< assert(hash2 != NULL);
<
582,584d553
< #if (LG_SIZEOF_PTR != LG_SIZEOF_INT)
< u.i = 0;
< #endif
586,601c555
< h = hash(&u.i, sizeof(u.i), UINT64_C(0xd983396e68886082));
< if (minbits <= 32) {
< /*
< * Avoid doing multiple hashes, since a single hash provides
< * enough bits.
< */
< ret1 = h & ZU(0xffffffffU);
< ret2 = h >> 32;
< } else {
< assert(SIZEOF_PTR == 8);
< ret1 = h;
< ret2 = hash(&u.i, sizeof(u.i), UINT64_C(0x5e2be9aff8709a5d));
< }
<
< *hash1 = ret1;
< *hash2 = ret2;
---
> hash(&u.i, sizeof(u.i), 0xd983396eU, r_hash);