aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/OffsetMemoryPool.cpp
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2019-01-21 18:38:21 +0000
committerGeorgios Pinitas <georgios.pinitas@arm.com>2019-01-23 11:45:28 +0000
commit734151d20bef56cbedce2ae67945f42cb4e265c8 (patch)
treeb51f5fb5ead440e0f7a5f38785f2f2564442d0f5 /src/runtime/OffsetMemoryPool.cpp
parente8c0c4397a508169282e5859410d5d6cdc87edbe (diff)
downloadComputeLibrary-734151d20bef56cbedce2ae67945f42cb4e265c8.tar.gz
COMPMID-1848: Account alignment in Offset-based pool allocations
Change-Id: I061d612341bf951a7d0e7ddd04a42139c8400d41 Reviewed-on: https://review.mlplatform.org/554 Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Michalis Spyrou <michalis.spyrou@arm.com>
Diffstat (limited to 'src/runtime/OffsetMemoryPool.cpp')
-rw-r--r--src/runtime/OffsetMemoryPool.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/runtime/OffsetMemoryPool.cpp b/src/runtime/OffsetMemoryPool.cpp
index 36eaf0ba1a..70cbe90bf0 100644
--- a/src/runtime/OffsetMemoryPool.cpp
+++ b/src/runtime/OffsetMemoryPool.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018 ARM Limited.
+ * Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -34,11 +34,11 @@
using namespace arm_compute;
-OffsetMemoryPool::OffsetMemoryPool(IAllocator *allocator, size_t blob_size)
- : _allocator(allocator), _blob(), _blob_size(blob_size)
+OffsetMemoryPool::OffsetMemoryPool(IAllocator *allocator, BlobInfo blob_info)
+ : _allocator(allocator), _blob(), _blob_info(blob_info)
{
ARM_COMPUTE_ERROR_ON(!allocator);
- _blob = _allocator->make_region(blob_size, 0);
+ _blob = _allocator->make_region(blob_info.size, blob_info.alignment);
}
void OffsetMemoryPool::acquire(MemoryMappings &handles)
@@ -49,7 +49,7 @@ void OffsetMemoryPool::acquire(MemoryMappings &handles)
for(auto &handle : handles)
{
ARM_COMPUTE_ERROR_ON(handle.first == nullptr);
- handle.first->set_owned_region(_blob->extract_subregion(handle.second, _blob_size - handle.second));
+ handle.first->set_owned_region(_blob->extract_subregion(handle.second, _blob_info.size - handle.second));
}
}
@@ -70,5 +70,5 @@ MappingType OffsetMemoryPool::mapping_type() const
std::unique_ptr<IMemoryPool> OffsetMemoryPool::duplicate()
{
ARM_COMPUTE_ERROR_ON(!_allocator);
- return support::cpp14::make_unique<OffsetMemoryPool>(_allocator, _blob_size);
+ return support::cpp14::make_unique<OffsetMemoryPool>(_allocator, _blob_info);
} \ No newline at end of file