summaryrefslogtreecommitdiffstats
path: root/vespalib
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@yahooinc.com>2022-03-28 16:02:41 +0200
committerTor Egge <Tor.Egge@yahooinc.com>2022-03-28 16:02:41 +0200
commit19f0ea267927337094b74f1735d4751ae2118bf2 (patch)
treebb07c9da666eeb48bd2c47be560f5bc70e0e2eae /vespalib
parentcef4316c3f87edd7ca747d3edb9b7b6f86dc31c9 (diff)
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);