diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-06-01 17:57:55 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2022-06-01 17:57:55 +0000 |
commit | b14e6942556bdfac63ab59adcdda4faf1a908cb2 (patch) | |
tree | 138f5be9eb0ab3a2635f325e9758593ef56ddfc1 /vespalib | |
parent | 176f92e919e14e55a4ed2c35467cfbe8bd3139a0 (diff) |
When you have no special needs, you should just take the default allocator.
Diffstat (limited to 'vespalib')
-rw-r--r-- | vespalib/src/vespa/vespalib/util/alloc.cpp | 5 | ||||
-rw-r--r-- | vespalib/src/vespa/vespalib/util/memory_allocator.h | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/vespalib/src/vespa/vespalib/util/alloc.cpp b/vespalib/src/vespa/vespalib/util/alloc.cpp index d7e134cbb5a..0a83d39ca09 100644 --- a/vespalib/src/vespa/vespalib/util/alloc.cpp +++ b/vespalib/src/vespa/vespalib/util/alloc.cpp @@ -491,6 +491,11 @@ MemoryAllocator::select_allocator(size_t mmapLimit, size_t alignment) { return & AutoAllocator::getAllocator(mmapLimit, alignment); } +const MemoryAllocator * +MemoryAllocator::select_allocator() { + return & AutoAllocator::getDefault(); +} + Alloc Alloc::allocHeap(size_t sz) { diff --git a/vespalib/src/vespa/vespalib/util/memory_allocator.h b/vespalib/src/vespa/vespalib/util/memory_allocator.h index d7a000e75b4..4f5374b0f11 100644 --- a/vespalib/src/vespa/vespalib/util/memory_allocator.h +++ b/vespalib/src/vespa/vespalib/util/memory_allocator.h @@ -37,7 +37,8 @@ public: static size_t roundUpToHugePages(size_t sz) { return (sz+(HUGEPAGE_SIZE-1)) & ~(HUGEPAGE_SIZE-1); } - static const MemoryAllocator * select_allocator(size_t mmapLimit = MemoryAllocator::HUGEPAGE_SIZE, size_t alignment=0); + static const MemoryAllocator * select_allocator(); + static const MemoryAllocator * select_allocator(size_t mmapLimit, size_t alignment); }; } |