From 3fca4d0cb57208b4e413935130d9396c4f9d02cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20T=2E=20Listwon?= Date: Sat, 10 Feb 2024 21:42:48 +0100 Subject: [PATCH] Link hash table primes externally to prevent data duplication in binary --- core/templates/hashfuncs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/templates/hashfuncs.h b/core/templates/hashfuncs.h index 05960292f5f..a16f6555249 100644 --- a/core/templates/hashfuncs.h +++ b/core/templates/hashfuncs.h @@ -429,7 +429,7 @@ struct HashMapComparatorDefault { constexpr uint32_t HASH_TABLE_SIZE_MAX = 29; -const uint32_t hash_table_size_primes[HASH_TABLE_SIZE_MAX] = { +inline constexpr uint32_t hash_table_size_primes[HASH_TABLE_SIZE_MAX] = { 5, 13, 23, @@ -462,7 +462,7 @@ const uint32_t hash_table_size_primes[HASH_TABLE_SIZE_MAX] = { }; // Computed with elem_i = UINT64_C (0 x FFFFFFFF FFFFFFFF ) / d_i + 1, where d_i is the i-th element of the above array. -const uint64_t hash_table_size_primes_inv[HASH_TABLE_SIZE_MAX] = { +inline constexpr uint64_t hash_table_size_primes_inv[HASH_TABLE_SIZE_MAX] = { 3689348814741910324, 1418980313362273202, 802032351030850071,