diff options
author | Tor Egge <Tor.Egge@yahooinc.com> | 2022-03-16 14:47:11 +0100 |
---|---|---|
committer | Tor Egge <Tor.Egge@yahooinc.com> | 2022-03-16 14:47:11 +0100 |
commit | 4afd9a0a47a57849ab59a1b8b98b43fe5e54e344 (patch) | |
tree | 454a4e42784e16ac653462d0857759116962cd80 /searchlib/src | |
parent | fa6f8584b18a498a03d26ca3d8b4813a075c5b90 (diff) |
Add acquire_multi_value_entry_ref() member function to multi value mapping base.
Diffstat (limited to 'searchlib/src')
-rw-r--r-- | searchlib/src/vespa/searchlib/attribute/multi_value_mapping.h | 2 | ||||
-rw-r--r-- | searchlib/src/vespa/searchlib/attribute/multi_value_mapping_base.h | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/searchlib/src/vespa/searchlib/attribute/multi_value_mapping.h b/searchlib/src/vespa/searchlib/attribute/multi_value_mapping.h index 71f1191e507..5ff502c207d 100644 --- a/searchlib/src/vespa/searchlib/attribute/multi_value_mapping.h +++ b/searchlib/src/vespa/searchlib/attribute/multi_value_mapping.h @@ -31,7 +31,7 @@ public: const vespalib::GrowStrategy &gs, std::shared_ptr<vespalib::alloc::MemoryAllocator> memory_allocator); ~MultiValueMapping() override; - ConstArrayRef get(uint32_t docId) const { return _store.get(_indices[docId].load_acquire()); } + ConstArrayRef get(uint32_t docId) const { return _store.get(acquire_multi_value_entry_ref(docId)); } ConstArrayRef getDataForIdx(EntryRef idx) const { return _store.get(idx); } void set(uint32_t docId, ConstArrayRef values); diff --git a/searchlib/src/vespa/searchlib/attribute/multi_value_mapping_base.h b/searchlib/src/vespa/searchlib/attribute/multi_value_mapping_base.h index e4588c8e743..ebf1eb179ba 100644 --- a/searchlib/src/vespa/searchlib/attribute/multi_value_mapping_base.h +++ b/searchlib/src/vespa/searchlib/attribute/multi_value_mapping_base.h @@ -39,6 +39,8 @@ protected: void updateValueCount(size_t oldValues, size_t newValues) { _totalValues += newValues - oldValues; } + + EntryRef acquire_multi_value_entry_ref(uint32_t docId) const noexcept { return _indices.acquire_elem_ref(docId).load_acquire(); } public: using RefCopyVector = vespalib::Array<EntryRef>; |