Skip to content

Commit

Permalink
Merge pull request #7131 from hoopoepg/topic/ucp-request-clean-in-debug
Browse files Browse the repository at this point in the history
UCP/REQUEST: added fake callback into request_put
  • Loading branch information
yosefe authored Jul 21, 2021
2 parents e6a1abf + c64666a commit 0456074
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/ucp/core/ucp_request.inl
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,18 @@
}


#if UCS_ENABLE_ASSERT
# define UCP_REQUEST_RESET(_req) \
(_req)->send.uct.func = \
(uct_pending_callback_t)ucs_empty_function_do_assert; \
(_req)->send.state.uct_comp.func = \
(uct_completion_callback_t)ucs_empty_function_do_assert_void; \
(_req)->send.state.uct_comp.count = 0;
#else /* UCS_ENABLE_ASSERT */
# define UCP_REQUEST_RESET(_req)
#endif /* UCS_ENABLE_ASSERT */


static UCS_F_ALWAYS_INLINE void ucp_request_id_reset(ucp_request_t *req)
{
req->id = UCS_PTR_MAP_KEY_INVALID;
Expand All @@ -190,6 +202,7 @@ ucp_request_put(ucp_request_t *req)
ucs_trace_req("put request %p", req);
ucp_request_id_check(req, ==, UCS_PTR_MAP_KEY_INVALID);
UCS_PROFILE_REQUEST_FREE(req);
UCP_REQUEST_RESET(req);
ucs_mpool_put_inline(req);
}

Expand Down
5 changes: 5 additions & 0 deletions src/ucs/sys/stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,8 @@ int ucs_empty_function_do_assert()
ucs_assert_always(0);
return 0;
}

void ucs_empty_function_do_assert_void()
{
ucs_assert_always(0);
}
1 change: 1 addition & 0 deletions src/ucs/sys/stubs.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ ucs_status_t ucs_empty_function_return_ep_timeout();
ssize_t ucs_empty_function_return_bc_ep_timeout();
ucs_status_t ucs_empty_function_return_busy();
int ucs_empty_function_do_assert();
void ucs_empty_function_do_assert_void();

END_C_DECLS

Expand Down

0 comments on commit 0456074

Please sign in to comment.