diff --git a/vespalib/src/tests/shared_string_repo/shared_string_repo_test.cpp b/vespalib/src/tests/shared_string_repo/shared_string_repo_test.cpp index 28cc7d7f7fe0..e746ae470d9c 100644 --- a/vespalib/src/tests/shared_string_repo/shared_string_repo_test.cpp +++ b/vespalib/src/tests/shared_string_repo/shared_string_repo_test.cpp @@ -294,8 +294,8 @@ TEST("require that initial stats are as expected") { size_t num_parts = 256; size_t part_size = 128; size_t hash_node_size = 12; - size_t entry_size = 72; - size_t initial_entries = 28; + size_t entry_size = 8 + sizeof(std::string); + size_t initial_entries = roundUp2inN(16 * entry_size) / entry_size; size_t initial_hash_used = 16; size_t initial_hash_allocated = 32; size_t part_limit = (uint32_t(-1) - 10000001) / num_parts; diff --git a/vespalib/src/vespa/vespalib/util/shared_string_repo.h b/vespalib/src/vespa/vespalib/util/shared_string_repo.h index efdd2ce3e098..9a77101266aa 100644 --- a/vespalib/src/vespa/vespalib/util/shared_string_repo.h +++ b/vespalib/src/vespa/vespalib/util/shared_string_repo.h @@ -5,7 +5,6 @@ #include "memoryusage.h" #include "string_id.h" #include "spin_lock.h" -#include #include #include #include @@ -14,6 +13,7 @@ #include #include #include +#include namespace vespalib { @@ -62,7 +62,7 @@ class SharedStringRepo { private: uint32_t _hash; uint32_t _ref_cnt; - vespalib::vespa_string _str; + std::string _str; public: explicit Entry(uint32_t next) noexcept : _hash(next), _ref_cnt(npos), _str() {}