diff options
Diffstat (limited to 'vespalib')
-rw-r--r-- | vespalib/src/vespa/vespalib/util/alloc.cpp | 6 | ||||
-rw-r--r-- | vespalib/src/vespa/vespalib/util/alloc.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/vespalib/src/vespa/vespalib/util/alloc.cpp b/vespalib/src/vespa/vespalib/util/alloc.cpp index 511593ba1d6..3cd8844dd73 100644 --- a/vespalib/src/vespa/vespalib/util/alloc.cpp +++ b/vespalib/src/vespa/vespalib/util/alloc.cpp @@ -546,6 +546,12 @@ Alloc::alloc(size_t sz) noexcept } Alloc +Alloc::alloc_aligned(size_t sz, size_t alignment) noexcept +{ + return Alloc(&AutoAllocator::getAllocator(MemoryAllocator::HUGEPAGE_SIZE, alignment), sz); +} + +Alloc Alloc::alloc(size_t sz, size_t mmapLimit, size_t alignment) noexcept { return Alloc(&AutoAllocator::getAllocator(mmapLimit, alignment), sz); diff --git a/vespalib/src/vespa/vespalib/util/alloc.h b/vespalib/src/vespa/vespalib/util/alloc.h index 5e71180f9be..71a3bd2407a 100644 --- a/vespalib/src/vespa/vespalib/util/alloc.h +++ b/vespalib/src/vespa/vespalib/util/alloc.h @@ -60,6 +60,7 @@ public: * is always used when size is above limit. */ static Alloc alloc(size_t sz) noexcept; + static Alloc alloc_aligned(size_t sz, size_t alignment) noexcept; static Alloc alloc(size_t sz, size_t mmapLimit, size_t alignment=0) noexcept; static Alloc alloc() noexcept; static Alloc alloc_with_allocator(const MemoryAllocator* allocator) noexcept; |