aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorHåvard Pettersen <havardpe@yahooinc.com>2022-05-03 09:27:04 +0000
committerHåvard Pettersen <havardpe@yahooinc.com>2022-05-03 09:39:32 +0000
commit2d0a77e003cf0cdfaf619d62af90ba0fb0aac710 (patch)
tree4905f240a081c2222b876268eb5ee0971296390d /searchcore
parentb942ed39f4d06cf714d62235978399910753a5b9 (diff)
use atomic operations to propagate bits and bitvector size
minor refactoring due to adding load/store word functions
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/vespa/searchcore/proton/documentmetastore/lid_allocator.h2
-rw-r--r--searchcore/src/vespa/searchcore/proton/documentmetastore/lidstatevector.h1
2 files changed, 2 insertions, 1 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/documentmetastore/lid_allocator.h b/searchcore/src/vespa/searchcore/proton/documentmetastore/lid_allocator.h
index e6327163aae..05795aee7d5 100644
--- a/searchcore/src/vespa/searchcore/proton/documentmetastore/lid_allocator.h
+++ b/searchcore/src/vespa/searchcore/proton/documentmetastore/lid_allocator.h
@@ -68,7 +68,7 @@ public:
return lid < _usedLids.size();
}
bool validLid(DocId lid) const {
- return (lid < _usedLids.size() && _usedLids.testBit(lid));
+ return (lid < _usedLids.getSizeSafe() && _usedLids.testBit(lid));
}
bool validLidSafe(DocId lid, uint32_t limit) const {
return (lid < limit && _usedLids.testBitSafe(lid));
diff --git a/searchcore/src/vespa/searchcore/proton/documentmetastore/lidstatevector.h b/searchcore/src/vespa/searchcore/proton/documentmetastore/lidstatevector.h
index 592ca23e63c..08bd93f063d 100644
--- a/searchcore/src/vespa/searchcore/proton/documentmetastore/lidstatevector.h
+++ b/searchcore/src/vespa/searchcore/proton/documentmetastore/lidstatevector.h
@@ -51,6 +51,7 @@ public:
bool testBit(unsigned int idx) const { return _bv.testBit(idx); }
bool testBitSafe(unsigned int idx) const { return _bv.testBitSafe(idx); }
unsigned int size() const { return _bv.size(); }
+ unsigned int getSizeSafe() const { return _bv.getSizeSafe(); }
unsigned int byteSize() const {
return _bv.extraByteSize() + sizeof(LidStateVector);
}