summaryrefslogtreecommitdiffstats
path: root/vespalib
diff options
context:
space:
mode:
authorGeir Storli <geirst@yahooinc.com>2022-03-28 17:56:58 +0200
committerGitHub <noreply@github.com>2022-03-28 17:56:58 +0200
commit827e0b55a041101de1155671775de182c8965969 (patch)
treeef90b6a562bb3444446acb2a2b9f11ebb251e2af /vespalib
parent0c6c20f84b33d8e32465acfc0c0c14443fa01228 (diff)
parent19f0ea267927337094b74f1735d4751ae2118bf2 (diff)
Merge pull request #21855 from vespa-engine/toregge/trim-down-rcuvector-interface
Trim down rcuvector interface.
Diffstat (limited to 'vespalib')
-rw-r--r--vespalib/src/vespa/vespalib/util/rcuvector.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/vespalib/src/vespa/vespalib/util/rcuvector.h b/vespalib/src/vespa/vespalib/util/rcuvector.h
index d2d0a946b91..fd0a7de441a 100644
--- a/vespalib/src/vespa/vespalib/util/rcuvector.h
+++ b/vespalib/src/vespa/vespalib/util/rcuvector.h
@@ -120,7 +120,6 @@ public:
size_t capacity() const { return _data.capacity(); }
void clear() { _data.clear(); }
T & operator[](size_t i) { return _data[i]; }
- const T & operator[](size_t i) const { return _data[i]; }
/*
* Readers holding a generation guard can call acquire_elem_ref(i)
* to get a const reference to element i. Array bound must be handled
@@ -128,6 +127,8 @@ public:
*/
const T& acquire_elem_ref(size_t i) const noexcept { return *(_vector_start.load(std::memory_order_acquire) + i); }
+ const T& get_elem_ref(size_t i) const noexcept { return _data[i]; } // Called from writer only
+
void reset();
void shrink(size_t newSize) __attribute__((noinline));
void replaceVector(ArrayType replacement);