summaryrefslogtreecommitdiffstats
path: root/vespalib/src
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@online.no>2023-06-16 15:48:30 +0200
committerTor Egge <Tor.Egge@online.no>2023-06-16 15:48:30 +0200
commit25517d0ff47d6d7cc4e23c7f7ee4c624adab38d2 (patch)
tree343066e322c52d5321e5fb325c6a0f8b1c083766 /vespalib/src
parentd7528edd89d55cca7196cff5504f85657157bf2f (diff)
Adjust class comment for ArrayStore.
Diffstat (limited to 'vespalib/src')
-rw-r--r--vespalib/src/vespa/vespalib/datastore/array_store.h24
1 files changed, 18 insertions, 6 deletions
diff --git a/vespalib/src/vespa/vespalib/datastore/array_store.h b/vespalib/src/vespa/vespalib/datastore/array_store.h
index 6532d597383..4a40c94766a 100644
--- a/vespalib/src/vespa/vespalib/datastore/array_store.h
+++ b/vespalib/src/vespa/vespalib/datastore/array_store.h
@@ -20,15 +20,27 @@
namespace vespalib::datastore {
/**
- * Datastore for storing arrays of type ElemT that is accessed via a 32-bit EntryRef.
+ * Datastore for storing arrays of type ElemT that is accessed via a 32-bit
+ * EntryRef.
*
- * The default EntryRef type uses 19 bits for offset (524288 values) and 13 bits for buffer id (8192 buffers).
+ * The default EntryRef type uses 19 bits for offset (524288 values) and 13
+ * bits for buffer id (8192 buffers).
*
- * Buffer type ids [1,maxSmallArrayTypeId] are used to allocate small arrays in datastore buffers.
- * The default type mapper uses a 1-to-1 mapping between type id and array size.
- * Buffer type id 0 is used to heap allocate large arrays as vespalib::Array instances.
+ * Buffer type ids [1,maxSmallArrayTypeId] are used to allocate small
+ * arrays in datastore buffers.
*
- * The max value of maxSmallArrayTypeId is (2^bufferBits - 1).
+ * The simple type mapper (ArrayStoreSimpleTypeMapper) uses a 1-to-1
+ * mapping between type id and array size.
+ *
+ * If the type mapper has defined a DynamicBufferType type
+ * (e.g. ArrayStoreDynamicTypeMapper) then the last part of the buffer type
+ * ids range might be for dynamic buffers where maximum array size can
+ * grow exponentially as buffer type id increases.
+ *
+ * Buffer type id 0 is used to heap allocate large arrays as
+ * vespalib::Array instances.
+ *
+ * The max value of maxSmallArrayTypeId is (2^(bufferBits - 3) - 1).
*/
template <typename ElemT, typename RefT = EntryRefT<19>, typename TypeMapperT = ArrayStoreSimpleTypeMapper<ElemT> >
class ArrayStore : public ICompactable