Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ucp_init should not be defined in the header #5404

Closed
vchuravy opened this issue Jul 13, 2020 · 1 comment
Closed

ucp_init should not be defined in the header #5404

vchuravy opened this issue Jul 13, 2020 · 1 comment

Comments

@vchuravy
Copy link

Header functions like are unfriendly to users who dynamically load libucp.so. The usual reason for a header function is speed and I don't think that applies for a function that is infrequently called like ucp_init.

ucx/src/ucp/api/ucp.h

Lines 1446 to 1452 in 0e37370

static inline ucs_status_t ucp_init(const ucp_params_t *params,
const ucp_config_t *config,
ucp_context_h *context_p)
{
return ucp_init_version(UCP_API_MAJOR, UCP_API_MINOR, params, config,
context_p);
}

@Keno
Copy link

Keno commented Jul 13, 2020

This kind of definition is a common trick to hardcode the API version into the calling binary to maintain ABI compatibility. I think if your client is not written in C, it's best to just call ucp_init_version with a hardcoded version directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants