Skip to content

Commit

Permalink
UCS/MEMTRACK: added public API for memtrach:
Browse files Browse the repository at this point in the history
- workaround for coverity
  • Loading branch information
Sergey Oblomov committed Jul 1, 2021
1 parent 208a422 commit 8343b0b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/ucs/debug/memtrack.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,11 @@ static UCS_F_NOINLINE void ucs_memtrack_do_releasing(void *ptr)

iter = kh_get(ucs_memtrack_ptr_hash, &ucs_memtrack_context.ptrs, (uintptr_t)ptr);
if (iter == kh_end(&ucs_memtrack_context.ptrs)) {
/* workaround for coverity - print debug message from unlocked
* memtrack */
pthread_mutex_unlock(&ucs_memtrack_context.lock);
ucs_debug("address %p not found in memtrack ptr hash", ptr);
goto out_unlock;
return;
}

/* remote pointer from hash */
Expand All @@ -261,7 +264,6 @@ static UCS_F_NOINLINE void ucs_memtrack_do_releasing(void *ptr)
ucs_memtrack_entry_update(entry, -size);
ucs_memtrack_entry_update(&ucs_memtrack_context.total, -size);

out_unlock:
pthread_mutex_unlock(&ucs_memtrack_context.lock);
}

Expand Down

0 comments on commit 8343b0b

Please sign in to comment.