From 3298ac1e93742e7a1ef5c4dc2e9b603dfa89d3cb Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Fri, 29 Dec 2023 17:43:50 -0800 Subject: fixes #1740 Public ID hash API This includes a manual page documenting the entire set of functions in one step. The hash is 64-bit based for now, to be maximally flexible. An internal 32-bit convenience for the common internal use is also provided (not public). The public API includes a test suite. --- src/core/socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/core/socket.c') diff --git a/src/core/socket.c b/src/core/socket.c index 1f44ebfa..d9fd5266 100644 --- a/src/core/socket.c +++ b/src/core/socket.c @@ -641,7 +641,7 @@ nni_sock_open(nni_sock **sockp, const nni_proto *proto) } nni_mtx_lock(&sock_lk); - if ((rv = nni_id_alloc(&sock_ids, &s->s_id, s)) != 0) { + if ((rv = nni_id_alloc32(&sock_ids, &s->s_id, s)) != 0) { nni_mtx_unlock(&sock_lk); sock_destroy(s); return (rv); @@ -1343,7 +1343,7 @@ nni_ctx_open(nni_ctx **ctxp, nni_sock *sock) nni_free(ctx, ctx->c_size); return (NNG_ECLOSED); } - if ((rv = nni_id_alloc(&ctx_ids, &ctx->c_id, ctx)) != 0) { + if ((rv = nni_id_alloc32(&ctx_ids, &ctx->c_id, ctx)) != 0) { nni_mtx_unlock(&sock_lk); nni_free(ctx, ctx->c_size); return (rv); -- cgit v1.2.3-70-g09d2