diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2023-07-05 18:41:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-05 18:41:57 +0200 |
commit | 20f74382b74533ac0faa5c3adb8e89e856562cc1 (patch) | |
tree | e935daec9a4f3af3816b835ec7361d5fe81192be /searchlib | |
parent | 247e26fde868c484df5e5523c834bee4d34f1fbe (diff) | |
parent | 3ff97270ad7aeb3f0a8350709855883cce0a23a0 (diff) |
Merge pull request #27644 from vespa-engine/toregge/use-provided-memory-allocator-for-large-arrays
Use provided memory allocator for large arrays.
Diffstat (limited to 'searchlib')
-rw-r--r-- | searchlib/src/vespa/searchlib/tensor/large_subspaces_buffer_type.h | 3 |
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); + } }; } |