diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2023-05-23 15:36:14 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2023-05-23 15:36:14 +0000 |
commit | 6525002fecd469b420615e5e1e0b1138234d9189 (patch) | |
tree | a64f4ce3de7549fdbf71748e3b0260b8c7804de6 /vespalib/src/tests/util | |
parent | 1412841e3297a21b602370d8faf82f7e5f919ebf (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.cpp | 9 |
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); } }; } |