Revert "Jemalloc updated to 4.4.0."

This reverts commit 36c1acc222.
This commit is contained in:
antirez
2017-04-22 13:12:42 +02:00
parent 6bc6bd4c38
commit 1a7a532e96
150 changed files with 6355 additions and 17238 deletions

View File

@ -35,7 +35,7 @@ typedef enum {
hash_variant_x64_128
} hash_variant_t;
static int
static size_t
hash_variant_bits(hash_variant_t variant)
{
@ -59,20 +59,19 @@ hash_variant_string(hash_variant_t variant)
}
}
#define KEY_SIZE 256
static void
hash_variant_verify_key(hash_variant_t variant, uint8_t *key)
hash_variant_verify(hash_variant_t variant)
{
const int hashbytes = hash_variant_bits(variant) / 8;
const int hashes_size = hashbytes * 256;
VARIABLE_ARRAY(uint8_t, hashes, hashes_size);
const size_t hashbytes = hash_variant_bits(variant) / 8;
uint8_t key[256];
VARIABLE_ARRAY(uint8_t, hashes, hashbytes * 256);
VARIABLE_ARRAY(uint8_t, final, hashbytes);
unsigned i;
uint32_t computed, expected;
memset(key, 0, KEY_SIZE);
memset(hashes, 0, hashes_size);
memset(final, 0, hashbytes);
memset(key, 0, sizeof(key));
memset(hashes, 0, sizeof(hashes));
memset(final, 0, sizeof(final));
/*
* Hash keys of the form {0}, {0,1}, {0,1,2}, ..., {0,1,...,255} as the
@ -103,17 +102,17 @@ hash_variant_verify_key(hash_variant_t variant, uint8_t *key)
/* Hash the result array. */
switch (variant) {
case hash_variant_x86_32: {
uint32_t out = hash_x86_32(hashes, hashes_size, 0);
uint32_t out = hash_x86_32(hashes, hashbytes*256, 0);
memcpy(final, &out, sizeof(out));
break;
} case hash_variant_x86_128: {
uint64_t out[2];
hash_x86_128(hashes, hashes_size, 0, out);
hash_x86_128(hashes, hashbytes*256, 0, out);
memcpy(final, out, sizeof(out));
break;
} case hash_variant_x64_128: {
uint64_t out[2];
hash_x64_128(hashes, hashes_size, 0, out);
hash_x64_128(hashes, hashbytes*256, 0, out);
memcpy(final, out, sizeof(out));
break;
} default: not_reached();
@ -140,19 +139,6 @@ hash_variant_verify_key(hash_variant_t variant, uint8_t *key)
hash_variant_string(variant), expected, computed);
}
static void
hash_variant_verify(hash_variant_t variant)
{
#define MAX_ALIGN 16
uint8_t key[KEY_SIZE + (MAX_ALIGN - 1)];
unsigned i;
for (i = 0; i < MAX_ALIGN; i++)
hash_variant_verify_key(variant, &key[i]);
#undef MAX_ALIGN
}
#undef KEY_SIZE
TEST_BEGIN(test_hash_x86_32)
{