diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2023-11-04 14:06:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-04 14:06:52 +0100 |
commit | 5c8dd8aab763d8ea282e69456faf779e3a1fb8fe (patch) | |
tree | 09eb38f8ad732bc2784efa20229957b5d9f8c928 /vespalib | |
parent | 8b1e7b15e11c0422a3b93bdc04c36e6e714461e9 (diff) |
Revert "No need to specify your own namespace."
Diffstat (limited to 'vespalib')
7 files changed, 10 insertions, 17 deletions
diff --git a/vespalib/src/vespa/vespalib/data/memory.cpp b/vespalib/src/vespa/vespalib/data/memory.cpp index fe9d3e97638..f20e3a27f73 100644 --- a/vespalib/src/vespa/vespalib/data/memory.cpp +++ b/vespalib/src/vespa/vespalib/data/memory.cpp @@ -11,8 +11,7 @@ Memory::make_string() const return vespalib::string(data, size); } -std::ostream & -operator<<(std::ostream &os, const Memory &memory) { +std::ostream &operator<<(std::ostream &os, const Memory &memory) { uint32_t written = 0; uint32_t hexCount = 25; os << "size: " << memory.size << "(bytes)" << std::endl; @@ -21,7 +20,7 @@ operator<<(std::ostream &os, const Memory &memory) { os << std::endl; written = 0; } - os << make_string("0x%02x ", memory.data[i] & 0xff); + os << vespalib::make_string("0x%02x ", memory.data[i] & 0xff); } if (written > 0) { os << std::endl; diff --git a/vespalib/src/vespa/vespalib/datastore/datastorebase.cpp b/vespalib/src/vespa/vespalib/datastore/datastorebase.cpp index c15d4784cc9..af320136815 100644 --- a/vespalib/src/vespa/vespalib/datastore/datastorebase.cpp +++ b/vespalib/src/vespa/vespalib/datastore/datastorebase.cpp @@ -110,8 +110,8 @@ DataStoreBase::switch_primary_buffer(uint32_t typeId, size_t entries_needed) { size_t buffer_id = getFirstFreeBufferId(); if (buffer_id >= getMaxNumBuffers()) { - LOG_ABORT(make_string("switch_primary_buffer(%u, %zu): did not find a free buffer", - typeId, entries_needed).c_str()); + LOG_ABORT(vespalib::make_string("switch_primary_buffer(%u, %zu): did not find a free buffer", + typeId, entries_needed).c_str()); } on_active(buffer_id, typeId, entries_needed); _primary_buffer_ids[typeId] = buffer_id; @@ -402,7 +402,7 @@ DataStoreBase::on_active(uint32_t bufferId, uint32_t typeId, size_t entries_need BufferAndMeta & bufferMeta = _buffers[bufferId]; BufferState *state = bufferMeta.get_state_relaxed(); if (state == nullptr) { - auto & newState = _stash.create<BufferState>(); + BufferState & newState = _stash.create<BufferState>(); if (_disable_entry_hold_list) { newState.disable_entry_hold_list(); } diff --git a/vespalib/src/vespa/vespalib/datastore/unique_store.h b/vespalib/src/vespa/vespalib/datastore/unique_store.h index 04bcc3fc10d..71346719932 100644 --- a/vespalib/src/vespa/vespalib/datastore/unique_store.h +++ b/vespalib/src/vespa/vespalib/datastore/unique_store.h @@ -51,8 +51,7 @@ private: using generation_t = vespalib::GenerationHandler::generation_t; public: - UniqueStore(std::shared_ptr<alloc::MemoryAllocator> memory_allocator, const std::function<ComparatorType(const DataStoreType&)>& comparator_factory); - explicit UniqueStore(std::shared_ptr<alloc::MemoryAllocator> memory_allocator); + UniqueStore(std::shared_ptr<alloc::MemoryAllocator> memory_allocator, const std::function<ComparatorType(const DataStoreType&)>& comparator_factory = [](const auto& data_store) { return ComparatorType(data_store);}); ~UniqueStore(); void set_dictionary(std::unique_ptr<IUniqueStoreDictionary> dict); UniqueStoreAddResult add(EntryConstRefType value); diff --git a/vespalib/src/vespa/vespalib/datastore/unique_store.hpp b/vespalib/src/vespa/vespalib/datastore/unique_store.hpp index b2c4d4e8d7e..a26db11ff31 100644 --- a/vespalib/src/vespa/vespalib/datastore/unique_store.hpp +++ b/vespalib/src/vespa/vespalib/datastore/unique_store.hpp @@ -28,11 +28,6 @@ using DefaultUniqueStoreDictionary = UniqueStoreDictionary<DefaultDictionary>; } template <typename EntryT, typename RefT, typename Comparator, typename Allocator> -UniqueStore<EntryT, RefT, Comparator, Allocator>::UniqueStore(std::shared_ptr<alloc::MemoryAllocator> memory_allocator) - : UniqueStore(std::move(memory_allocator), [](const auto& data_store) { return ComparatorType(data_store);}) -{} - -template <typename EntryT, typename RefT, typename Comparator, typename Allocator> UniqueStore<EntryT, RefT, Comparator, Allocator>::UniqueStore(std::shared_ptr<alloc::MemoryAllocator> memory_allocator, const std::function<ComparatorType(const DataStoreType&)>& comparator_factory) : _allocator(std::move(memory_allocator)), _store(_allocator.get_data_store()), diff --git a/vespalib/src/vespa/vespalib/datastore/unique_store_allocator.h b/vespalib/src/vespa/vespalib/datastore/unique_store_allocator.h index 962084f3a4b..d3b3696f042 100644 --- a/vespalib/src/vespa/vespalib/datastore/unique_store_allocator.h +++ b/vespalib/src/vespa/vespalib/datastore/unique_store_allocator.h @@ -31,7 +31,7 @@ private: UniqueStoreBufferType<WrappedEntryType> _typeHandler; public: - explicit UniqueStoreAllocator(std::shared_ptr<alloc::MemoryAllocator> memory_allocator); + UniqueStoreAllocator(std::shared_ptr<alloc::MemoryAllocator> memory_allocator); ~UniqueStoreAllocator() override; EntryRef allocate(const EntryType& value); void hold(EntryRef ref); diff --git a/vespalib/src/vespa/vespalib/portal/portal.cpp b/vespalib/src/vespa/vespalib/portal/portal.cpp index 8e91e2b5caf..9d9a9dc1557 100644 --- a/vespalib/src/vespa/vespalib/portal/portal.cpp +++ b/vespalib/src/vespa/vespalib/portal/portal.cpp @@ -200,7 +200,7 @@ Portal::Portal(CryptoEngine::SP crypto, int port) handle_accept(std::move(guard), std::move(socket)); } }); - _my_host = make_string("%s:%d", HostName::get().c_str(), listen_port()); + _my_host = vespalib::make_string("%s:%d", HostName::get().c_str(), listen_port()); } Portal::~Portal() diff --git a/vespalib/src/vespa/vespalib/util/rusage.cpp b/vespalib/src/vespa/vespalib/util/rusage.cpp index b0245a4e814..f582dddad97 100644 --- a/vespalib/src/vespa/vespalib/util/rusage.cpp +++ b/vespalib/src/vespa/vespalib/util/rusage.cpp @@ -48,7 +48,7 @@ RUsage::createSelf(vespalib::steady_time since) RUsage r; r._time = vespalib::steady_clock::now() - since; if (getrusage(RUSAGE_SELF, &r) != 0) { - throw std::runtime_error(make_string("getrusage failed with errno = %d", errno).c_str()); + throw std::runtime_error(vespalib::make_string("getrusage failed with errno = %d", errno).c_str()); } return r; } @@ -59,7 +59,7 @@ RUsage::createChildren(vespalib::steady_time since) RUsage r; r._time = vespalib::steady_clock::now() - since; if (getrusage(RUSAGE_CHILDREN, &r) != 0) { - throw std::runtime_error(make_string("getrusage failed with errno = %d", errno).c_str()); + throw std::runtime_error(vespalib::make_string("getrusage failed with errno = %d", errno).c_str()); } return r; } |