Skip to content

Commit

Permalink
Merge pull request #33116 from vespa-engine/toregge/use-std-string-in…
Browse files Browse the repository at this point in the history
…-shared-string-repo

Use std::string in shared string repo.
  • Loading branch information
vekterli authored Jan 15, 2025
2 parents 39b9122 + 57350c0 commit 6682d6e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions vespalib/src/vespa/vespalib/util/shared_string_repo.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include "memoryusage.h"
#include "string_id.h"
#include "spin_lock.h"
#include <vespa/vespalib/stllike/small_string.h>
#include <vespa/vespalib/stllike/identity.h>
#include <vespa/vespalib/stllike/allocator.h>
#include <vespa/vespalib/stllike/hashtable.hpp>
Expand All @@ -14,6 +13,7 @@
#include <array>
#include <cctype>
#include <limits>
#include <string>

namespace vespalib {

Expand Down Expand Up @@ -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() {}
Expand Down

0 comments on commit 6682d6e

Please sign in to comment.