aboutsummaryrefslogtreecommitdiffstats
path: root/vespalib/src/tests/util
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2023-05-23 15:36:14 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2023-05-23 15:36:14 +0000
commit6525002fecd469b420615e5e1e0b1138234d9189 (patch)
treea64f4ce3de7549fdbf71748e3b0260b8c7804de6 /vespalib/src/tests/util
parent1412841e3297a21b602370d8faf82f7e5f919ebf (diff)
Ensure that all memory provided by any allocator are within the 57 low bits of the address.
- Replace sdt::pair<void *, size> with a purpose built class enforcing this.
Diffstat (limited to 'vespalib/src/tests/util')
-rw-r--r--vespalib/src/tests/util/mmap_file_allocator/mmap_file_allocator_test.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/vespalib/src/tests/util/mmap_file_allocator/mmap_file_allocator_test.cpp b/vespalib/src/tests/util/mmap_file_allocator/mmap_file_allocator_test.cpp
index 545733a1ebd..ef16998902e 100644
--- a/vespalib/src/tests/util/mmap_file_allocator/mmap_file_allocator_test.cpp
+++ b/vespalib/src/tests/util/mmap_file_allocator/mmap_file_allocator_test.cpp
@@ -6,6 +6,7 @@
using vespalib::alloc::MemoryAllocator;
using vespalib::alloc::MmapFileAllocator;
+using vespalib::alloc::PtrAndSize;
namespace {
@@ -18,10 +19,10 @@ struct MyAlloc
void* data;
size_t size;
- MyAlloc(MemoryAllocator& allocator_in, MemoryAllocator::PtrAndSize buf)
+ MyAlloc(MemoryAllocator& allocator_in, PtrAndSize buf)
: allocator(allocator_in),
- data(buf.first),
- size(buf.second)
+ data(buf.get()),
+ size(buf.size())
{
}
@@ -30,7 +31,7 @@ struct MyAlloc
allocator.free(data, size);
}
- MemoryAllocator::PtrAndSize asPair() const noexcept { return std::make_pair(data, size); }
+ PtrAndSize asPair() const noexcept { return PtrAndSize(data, size); }
};
}