aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/BlobMemoryPool.cpp
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2018-11-14 13:16:56 +0000
committerIsabella Gottardi <isabella.gottardi@arm.com>2018-11-21 09:52:04 +0000
commitdf3103622b7de05f4e35b22a2c94b4a46eab4efc (patch)
tree17e10253e7a069c69d10bea0882b699b99d74b86 /src/runtime/BlobMemoryPool.cpp
parentc47ef20d69e8ea0f519fdc679435cd7037fc18fe (diff)
downloadComputeLibrary-df3103622b7de05f4e35b22a2c94b4a46eab4efc.tar.gz
COMPMID-1088: Use IMemoryRegion in interfaces where possible
-Simplifies import memory interface -Changes the used of void** handles with appropriate interfaces. Change-Id: I5918c855c11f46352058864623336b352162a4b7
Diffstat (limited to 'src/runtime/BlobMemoryPool.cpp')
-rw-r--r--src/runtime/BlobMemoryPool.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/runtime/BlobMemoryPool.cpp b/src/runtime/BlobMemoryPool.cpp
index 29505e57fc..e09451cd62 100644
--- a/src/runtime/BlobMemoryPool.cpp
+++ b/src/runtime/BlobMemoryPool.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017 ARM Limited.
+ * Copyright (c) 2017-2018 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -52,7 +52,7 @@ void BlobMemoryPool::acquire(MemoryMappings &handles)
for(auto &handle : handles)
{
ARM_COMPUTE_ERROR_ON(handle.first == nullptr);
- *handle.first = _blobs[handle.second];
+ handle.first->set_region(_blobs[handle.second].get());
}
}
@@ -61,7 +61,7 @@ void BlobMemoryPool::release(MemoryMappings &handles)
for(auto &handle : handles)
{
ARM_COMPUTE_ERROR_ON(handle.first == nullptr);
- *handle.first = nullptr;
+ handle.first->set_region(nullptr);
}
}
@@ -82,17 +82,11 @@ void BlobMemoryPool::allocate_blobs(const std::vector<size_t> &sizes)
for(const auto &size : sizes)
{
- _blobs.push_back(_allocator->allocate(size, 0));
+ _blobs.push_back(_allocator->make_region(size, 0));
}
}
void BlobMemoryPool::free_blobs()
{
- ARM_COMPUTE_ERROR_ON(!_allocator);
-
- for(auto &blob : _blobs)
- {
- _allocator->free(blob);
- }
_blobs.clear();
} \ No newline at end of file