diff options
author | Geir Storli <geirst@verizonmedia.com> | 2020-08-31 13:56:19 +0000 |
---|---|---|
committer | Geir Storli <geirst@verizonmedia.com> | 2020-08-31 13:58:43 +0000 |
commit | e35cb626e2825376f4c88d62d5466bd8c205a8d4 (patch) | |
tree | cc6b8737fd9d1ee3433278c41596146063722f69 /vespalib | |
parent | 078b0dcd710adc8bd53add3fb482b920d8806a93 (diff) |
Implement store for heap allocated tensors.
Diffstat (limited to 'vespalib')
-rw-r--r-- | vespalib/src/vespa/vespalib/datastore/datastore.h | 1 | ||||
-rw-r--r-- | vespalib/src/vespa/vespalib/datastore/datastore.hpp | 8 |
2 files changed, 8 insertions, 1 deletions
diff --git a/vespalib/src/vespa/vespalib/datastore/datastore.h b/vespalib/src/vespa/vespalib/datastore/datastore.h index 193869a5591..4b908452b32 100644 --- a/vespalib/src/vespa/vespalib/datastore/datastore.h +++ b/vespalib/src/vespa/vespalib/datastore/datastore.h @@ -106,6 +106,7 @@ public: DataStore(const DataStore &rhs) = delete; DataStore &operator=(const DataStore &rhs) = delete; DataStore(); + DataStore(uint32_t min_arrays); ~DataStore(); EntryRef addEntry(const EntryType &e); diff --git a/vespalib/src/vespa/vespalib/datastore/datastore.hpp b/vespalib/src/vespa/vespalib/datastore/datastore.hpp index 6549425b022..ad35f3c7383 100644 --- a/vespalib/src/vespa/vespalib/datastore/datastore.hpp +++ b/vespalib/src/vespa/vespalib/datastore/datastore.hpp @@ -133,8 +133,14 @@ DataStoreT<RefT>::freeListRawAllocator(uint32_t typeId) template <typename EntryType, typename RefT> DataStore<EntryType, RefT>::DataStore() + : DataStore(RefType::offsetSize()) +{ +} + +template <typename EntryType, typename RefT> +DataStore<EntryType, RefT>::DataStore(uint32_t min_arrays) : ParentType(), - _type(1, RefType::offsetSize(), RefType::offsetSize()) + _type(1, min_arrays, RefType::offsetSize()) { addType(&_type); initActiveBuffers(); |