diff options
6 files changed, 12 insertions, 12 deletions
diff --git a/vespalib/src/tests/datastore/datastore/datastore_test.cpp b/vespalib/src/tests/datastore/datastore/datastore_test.cpp index fb7a38aacb6..9e27ed37dd3 100644 --- a/vespalib/src/tests/datastore/datastore/datastore_test.cpp +++ b/vespalib/src/tests/datastore/datastore/datastore_test.cpp @@ -87,7 +87,7 @@ public: while (sizes.size() < bufs) { RefType iRef = (_type.getArraySize() == 1) ? (_store.template allocator<DataType>(_typeId).alloc().ref) : - (_store.template allocator<DataType>(_typeId).allocArray(_type.getArraySize()).ref); + (_store.template allocator<DataType>(_typeId).allocArray().ref); int bufferId = iRef.bufferId(); if (bufferId != prevBufferId) { if (prevBufferId >= 0) { @@ -126,7 +126,7 @@ public: while (buffers.size() < bufs) { RefType iRef = (_type.getArraySize() == 1) ? (_store.template allocator<DataType>(_typeId).alloc().ref) : - (_store.template allocator<DataType>(_typeId).allocArray(_type.getArraySize()).ref); + (_store.template allocator<DataType>(_typeId).allocArray().ref); int buffer_id = iRef.bufferId(); if (buffers.empty() || buffers.back() != buffer_id) { buffers.push_back(buffer_id); diff --git a/vespalib/src/vespa/vespalib/btree/btreestore.hpp b/vespalib/src/vespa/vespalib/btree/btreestore.hpp index 36c47e8bfb0..90c302af5e4 100644 --- a/vespalib/src/vespa/vespalib/btree/btreestore.hpp +++ b/vespalib/src/vespa/vespalib/btree/btreestore.hpp @@ -74,7 +74,7 @@ allocNewKeyData(uint32_t clusterSize) { assert(clusterSize >= 1 && clusterSize <= clusterLimit); uint32_t typeId = clusterSize - 1; - return _store.allocator<KeyDataType>(typeId).allocArray(clusterSize); + return _store.allocator<KeyDataType>(typeId).allocArray(); } @@ -87,7 +87,7 @@ allocKeyData(uint32_t clusterSize) { assert(clusterSize >= 1 && clusterSize <= clusterLimit); uint32_t typeId = clusterSize - 1; - return _store.freeListAllocator<KeyDataType, datastore::DefaultReclaimer<KeyDataType>>(typeId).allocArray(clusterSize); + return _store.freeListAllocator<KeyDataType, datastore::DefaultReclaimer<KeyDataType>>(typeId).allocArray(); } diff --git a/vespalib/src/vespa/vespalib/datastore/allocator.h b/vespalib/src/vespa/vespalib/datastore/allocator.h index 209ce1a5f26..30938bdc1c1 100644 --- a/vespalib/src/vespa/vespalib/datastore/allocator.h +++ b/vespalib/src/vespa/vespalib/datastore/allocator.h @@ -30,7 +30,7 @@ public: HandleType alloc(Args && ... args); HandleType allocArray(ConstArrayRef array); - HandleType allocArray(size_t array_size); + HandleType allocArray(); }; } diff --git a/vespalib/src/vespa/vespalib/datastore/allocator.hpp b/vespalib/src/vespa/vespalib/datastore/allocator.hpp index 20b22a032f0..fa97ef9a5f5 100644 --- a/vespalib/src/vespa/vespalib/datastore/allocator.hpp +++ b/vespalib/src/vespa/vespalib/datastore/allocator.hpp @@ -52,14 +52,14 @@ Allocator<EntryT, RefT>::allocArray(ConstArrayRef array) template <typename EntryT, typename RefT> typename Allocator<EntryT, RefT>::HandleType -Allocator<EntryT, RefT>::allocArray(size_t array_size) +Allocator<EntryT, RefT>::allocArray() { _store.ensure_buffer_capacity(_typeId, 1); uint32_t buffer_id = _store.primary_buffer_id(_typeId); BufferState &state = _store.getBufferState(buffer_id); assert(state.isActive()); RefT ref(state.size(), buffer_id); - assert(array_size == state.getArraySize()); + auto array_size = state.getArraySize(); EntryT *buf = _store.template getEntryArray<EntryT>(ref, array_size); for (size_t i = 0; i < array_size; ++i) { new (static_cast<void *>(buf + i)) EntryT(); diff --git a/vespalib/src/vespa/vespalib/datastore/free_list_allocator.h b/vespalib/src/vespa/vespalib/datastore/free_list_allocator.h index 6d28d76726f..dc2d1ea3c34 100644 --- a/vespalib/src/vespa/vespalib/datastore/free_list_allocator.h +++ b/vespalib/src/vespa/vespalib/datastore/free_list_allocator.h @@ -29,7 +29,7 @@ public: HandleType alloc(Args && ... args); HandleType allocArray(ConstArrayRef array); - HandleType allocArray(size_t array_size); + HandleType allocArray(); }; } diff --git a/vespalib/src/vespa/vespalib/datastore/free_list_allocator.hpp b/vespalib/src/vespa/vespalib/datastore/free_list_allocator.hpp index 6429f433aaf..4e69db08a3c 100644 --- a/vespalib/src/vespa/vespalib/datastore/free_list_allocator.hpp +++ b/vespalib/src/vespa/vespalib/datastore/free_list_allocator.hpp @@ -83,16 +83,16 @@ FreeListAllocator<EntryT, RefT, ReclaimerT>::allocArray(ConstArrayRef array) template <typename EntryT, typename RefT, typename ReclaimerT> typename Allocator<EntryT, RefT>::HandleType -FreeListAllocator<EntryT, RefT, ReclaimerT>::allocArray(size_t array_size) +FreeListAllocator<EntryT, RefT, ReclaimerT>::allocArray() { auto& free_list = _store.getFreeList(_typeId); if (free_list.empty()) { - return ParentType::allocArray(array_size); + return ParentType::allocArray(); } RefT ref = free_list.pop_entry(); auto& state = _store.getBufferState(ref.bufferId()); - assert(array_size == state.getArraySize()); - EntryT *buf = _store.template getEntryArray<EntryT>(ref, array_size); + auto size = state.getArraySize(); + EntryT *buf = _store.template getEntryArray<EntryT>(ref, size); return HandleType(ref, buf); } |