summaryrefslogtreecommitdiffstats
path: root/vespalib/src
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2016-10-16 20:15:08 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2016-10-16 20:15:08 +0000
commitefdb649baec149d67638edda831ed85c48ef9e92 (patch)
tree8bcf25b641344eaaaf146842cab3a5547f3ab4e8 /vespalib/src
parent3dc92c36aa6f58a2ce2f57089501364dab6a44bc (diff)
Follow api change
Diffstat (limited to 'vespalib/src')
-rw-r--r--vespalib/src/tests/alloc/alloc_test.cpp14
-rw-r--r--vespalib/src/tests/exception_classes/mmap.cpp2
-rw-r--r--vespalib/src/vespa/vespalib/util/alloc.cpp2
3 files changed, 9 insertions, 9 deletions
diff --git a/vespalib/src/tests/alloc/alloc_test.cpp b/vespalib/src/tests/alloc/alloc_test.cpp
index 8a1049f2784..52ca4034611 100644
--- a/vespalib/src/tests/alloc/alloc_test.cpp
+++ b/vespalib/src/tests/alloc/alloc_test.cpp
@@ -53,13 +53,13 @@ Test::testBasic()
EXPECT_TRUE(h.get() != nullptr);
}
{
- EXPECT_EXCEPTION(Alloc::allocAlignedHeap(100, 7), IllegalArgumentException, "Alloc::allocAlignedHeapAlloc(100, 7) does not support 7 alignment");
- Alloc h = Alloc::allocAlignedHeapAlloc(100, 1024);
+ EXPECT_EXCEPTION(Alloc::allocAlignedHeap(100, 7), IllegalArgumentException, "Alloc::allocAlignedHeap(100, 7) does not support 7 alignment");
+ Alloc h = Alloc::allocAlignedHeap(100, 1024);
EXPECT_EQUAL(100u, h.size());
EXPECT_TRUE(h.get() != nullptr);
}
{
- Alloc h = MMapAllocFactory::create(100);
+ Alloc h = Alloc::allocMMap(100);
EXPECT_EQUAL(100u, h.size());
EXPECT_TRUE(h.get() != nullptr);
}
@@ -68,7 +68,7 @@ Test::testBasic()
testSwap(a, b);
}
{
- Alloc a = MMapAllocFactory::create(100), b = MMapAllocFactory::create(200);
+ Alloc a = Alloc::allocMMap(100), b = Alloc::allocMMap(200);
testSwap(a, b);
}
{
@@ -77,7 +77,7 @@ Test::testBasic()
}
{
Alloc a = Alloc::allocHeap(100);
- Alloc b = MMapAllocFactory::create(200);
+ Alloc b = Alloc::allocMMap(200);
testSwap(a, b);
}
{
@@ -92,13 +92,13 @@ void
Test::testAlignedAllocation()
{
{
- Alloc buf = AutoAllocFactory::create(10, MemoryAllocator::HUGEPAGE_SIZE, 1024);
+ Alloc buf = Alloc::alloc(10, MemoryAllocator::HUGEPAGE_SIZE, 1024);
EXPECT_TRUE(reinterpret_cast<ptrdiff_t>(buf.get()) % 1024 == 0);
}
{
// Mmapped pointers are page-aligned, but sanity test anyway.
- Alloc buf = AutoAllocFactory::create(3000000, MemoryAllocator::HUGEPAGE_SIZE, 512);
+ Alloc buf = Alloc::alloc(3000000, MemoryAllocator::HUGEPAGE_SIZE, 512);
EXPECT_TRUE(reinterpret_cast<ptrdiff_t>(buf.get()) % 512 == 0);
}
}
diff --git a/vespalib/src/tests/exception_classes/mmap.cpp b/vespalib/src/tests/exception_classes/mmap.cpp
index fe0a8fc4556..5068420eaff 100644
--- a/vespalib/src/tests/exception_classes/mmap.cpp
+++ b/vespalib/src/tests/exception_classes/mmap.cpp
@@ -15,7 +15,7 @@ int main(int argc, char *argv[]) {
assert(setrlimit(RLIMIT_AS, &virtualLimit) == 0);
std::vector<Alloc> mappings;
for (size_t i(0); i < numBlocks; i++) {
- mappings.emplace_back(MMapAllocFactory::create(blockSize));
+ mappings.emplace_back(Alloc::allocMMap(blockSize));
memset(mappings.back().get(), 0xa5, mappings.back().size());
}
return 0;
diff --git a/vespalib/src/vespa/vespalib/util/alloc.cpp b/vespalib/src/vespa/vespalib/util/alloc.cpp
index 7b47802f8c8..e95a9d2d652 100644
--- a/vespalib/src/vespa/vespalib/util/alloc.cpp
+++ b/vespalib/src/vespa/vespalib/util/alloc.cpp
@@ -373,7 +373,7 @@ Alloc::allocAlignedHeap(size_t sz, size_t alignment)
} else if (alignment == 0x1000) {
return Alloc(&AlignedHeapAllocator::get4K(), sz);
} else {
- throw IllegalArgumentException(make_string("Alloc::allocAlignedHeap::create(%zu, %zu) does not support %zu alignment", sz, alignment, alignment));
+ throw IllegalArgumentException(make_string("Alloc::allocAlignedHeap(%zu, %zu) does not support %zu alignment", sz, alignment, alignment));
}
}