From df3103622b7de05f4e35b22a2c94b4a46eab4efc Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Wed, 14 Nov 2018 13:16:56 +0000 Subject: COMPMID-1088: Use IMemoryRegion in interfaces where possible -Simplifies import memory interface -Changes the used of void** handles with appropriate interfaces. Change-Id: I5918c855c11f46352058864623336b352162a4b7 --- src/runtime/BlobMemoryPool.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'src/runtime/BlobMemoryPool.cpp') 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 &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 -- cgit v1.2.1