summaryrefslogtreecommitdiffstats
path: root/searchlib/src
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@broadpark.no>2021-02-13 23:43:31 +0100
committerTor Egge <Tor.Egge@broadpark.no>2021-02-13 23:52:02 +0100
commit3ecf2e1b0aeed121fa8b588bbe3e50a70386c91d (patch)
tree75998f42eedef44f28019035ca070b4331bfa2c0 /searchlib/src
parentecee339b9aa8793a8689b1916821027ae1f48503 (diff)
Add alloc_aligned member function.
Diffstat (limited to 'searchlib/src')
-rw-r--r--searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp3
-rw-r--r--searchlib/src/vespa/searchlib/util/comprbuffer.cpp3
2 files changed, 2 insertions, 4 deletions
diff --git a/searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp b/searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp
index 8ba4232a5c6..9e8203f352e 100644
--- a/searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp
+++ b/searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp
@@ -14,7 +14,6 @@
#include <vespa/vespalib/stllike/asciistream.h>
#include <vespa/vespalib/test/insertion_operators.h>
#include <vespa/vespalib/util/exceptions.h>
-#include <vespa/vespalib/util/memory_allocator.h>
#include <vespa/vespalib/util/threadstackexecutor.h>
#include <iomanip>
@@ -139,7 +138,7 @@ TEST("test that DirectIOPadding works accordng to spec") {
FastOS_File file("directio.test");
file.EnableDirectIO();
EXPECT_TRUE(file.OpenReadWrite());
- Alloc buf(Alloc::alloc(FILE_SIZE, MemoryAllocator::HUGEPAGE_SIZE, 4096));
+ Alloc buf(Alloc::alloc_aligned(FILE_SIZE, 4096));
memset(buf.get(), 'a', buf.size());
EXPECT_EQUAL(FILE_SIZE, file.Write2(buf.get(), FILE_SIZE));
size_t padBefore(0);
diff --git a/searchlib/src/vespa/searchlib/util/comprbuffer.cpp b/searchlib/src/vespa/searchlib/util/comprbuffer.cpp
index 35c4abafca4..4a3e79fdb76 100644
--- a/searchlib/src/vespa/searchlib/util/comprbuffer.cpp
+++ b/searchlib/src/vespa/searchlib/util/comprbuffer.cpp
@@ -2,7 +2,6 @@
#include "comprbuffer.h"
#include <vespa/fastos/file.h>
-#include <vespa/vespalib/util/memory_allocator.h>
#include <cassert>
#include <cstring>
@@ -74,7 +73,7 @@ ComprBuffer::allocComprBuf()
}
size_t fullpadding = paddingAfter + paddingBefore;
size_t allocLen = _comprBufSize * _unitSize + fullpadding;
- _comprAlloc = Alloc::alloc(allocLen, vespalib::alloc::MemoryAllocator::HUGEPAGE_SIZE, memalign);
+ _comprAlloc = Alloc::alloc_aligned(allocLen, memalign);
void *alignedBuf = _comprAlloc.get();
memset(alignedBuf, 0, allocLen);
/*