diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2018-11-14 13:16:56 +0000 |
---|---|---|
committer | Isabella Gottardi <isabella.gottardi@arm.com> | 2018-11-21 09:52:04 +0000 |
commit | df3103622b7de05f4e35b22a2c94b4a46eab4efc (patch) | |
tree | 17e10253e7a069c69d10bea0882b699b99d74b86 /src/runtime/BlobMemoryPool.cpp | |
parent | c47ef20d69e8ea0f519fdc679435cd7037fc18fe (diff) | |
download | ComputeLibrary-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.cpp | 14 |
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 |