aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@online.no>2023-07-05 17:03:38 +0200
committerTor Egge <Tor.Egge@online.no>2023-07-05 17:03:38 +0200
commit3ff97270ad7aeb3f0a8350709855883cce0a23a0 (patch)
treed38188ad891a3a449e1525cc04a60ffe6d6b01f6 /searchlib/src
parenta52700972fad8fc8b98d7eafc41086499a8fbd56 (diff)
Use provided memory allocator for large arrays.
Diffstat (limited to 'searchlib/src')
-rw-r--r--searchlib/src/vespa/searchlib/tensor/large_subspaces_buffer_type.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/searchlib/src/vespa/searchlib/tensor/large_subspaces_buffer_type.h b/searchlib/src/vespa/searchlib/tensor/large_subspaces_buffer_type.h
index 8cce08e9d81..835bc55fd40 100644
--- a/searchlib/src/vespa/searchlib/tensor/large_subspaces_buffer_type.h
+++ b/searchlib/src/vespa/searchlib/tensor/large_subspaces_buffer_type.h
@@ -35,6 +35,9 @@ public:
void fallback_copy(void *newBuffer, const void *oldBuffer, EntryCount num_entries) override;
void initialize_reserved_entries(void *buffer, EntryCount reserved_entries) override;
const vespalib::alloc::MemoryAllocator* get_memory_allocator() const override;
+ vespalib::alloc::Alloc initial_alloc() const noexcept {
+ return _memory_allocator ? vespalib::alloc::Alloc::alloc_with_allocator(_memory_allocator.get()) : vespalib::alloc::Alloc::alloc(0, vespalib::alloc::MemoryAllocator::HUGEPAGE_SIZE);
+ }
};
}