Skip to content

Commit 69f2992

Browse files
committed
Fix disjoint pool coverity issues
1 parent 4f8c3d1 commit 69f2992

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

source/common/umf_pools/disjoint_pool.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,7 @@ void *DisjointPool::malloc(size_t size) { // For full-slab allocations indicates
913913
auto Ptr = impl->allocate(size, FromPool);
914914

915915
if (impl->getParams().PoolTrace > 2) {
916-
auto MT = impl->getParams().name;
916+
const auto &MT = impl->getParams().name;
917917
std::cout << "Allocated " << std::setw(8) << size << " " << MT
918918
<< " bytes from " << (FromPool ? "Pool" : "Provider") << " ->"
919919
<< Ptr << std::endl;
@@ -938,7 +938,7 @@ void *DisjointPool::aligned_malloc(size_t size, size_t alignment) {
938938
auto Ptr = impl->allocate(size, alignment, FromPool);
939939

940940
if (impl->getParams().PoolTrace > 2) {
941-
auto MT = impl->getParams().name;
941+
const auto &MT = impl->getParams().name;
942942
std::cout << "Allocated " << std::setw(8) << size << " " << MT
943943
<< " bytes aligned at " << alignment << " from "
944944
<< (FromPool ? "Pool" : "Provider") << " ->" << Ptr
@@ -957,7 +957,7 @@ enum umf_result_t DisjointPool::free(void *ptr) try {
957957
impl->deallocate(ptr, ToPool);
958958

959959
if (impl->getParams().PoolTrace > 2) {
960-
auto MT = impl->getParams().name;
960+
const auto &MT = impl->getParams().name;
961961
std::cout << "Freed " << MT << " " << ptr << " to "
962962
<< (ToPool ? "Pool" : "Provider")
963963
<< ", Current total pool size "

0 commit comments

Comments
 (0)