From 4f5e11c391c4a8f1b2731aee5ad47bc0c925042a Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sat, 15 Aug 2020 14:09:17 -0700 Subject: fixes #1289 zerotier should have it's own copy of the id hashing code fixes #1288 id allocation can overallocate fixes #1126 consider removing lock from idhash This substantially refactors the id hash code, giving a cleaner API, and eliminating a extra locking as well as some wasteful allocations. The ZeroTier code has it's own copy, that is 64-bit friendly, as the rest of the consumers need only a simpler 32-bit API. --- include/nng/nng.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/nng/nng.h b/include/nng/nng.h index 6f5fdd45..3e70bc8f 100644 --- a/include/nng/nng.h +++ b/include/nng/nng.h @@ -761,10 +761,8 @@ NNG_DECL nng_dialer nng_pipe_dialer(nng_pipe); NNG_DECL nng_listener nng_pipe_listener(nng_pipe); // Flags. -enum nng_flag_enum { - NNG_FLAG_ALLOC = 1, // Recv to allocate receive buffer. - NNG_FLAG_NONBLOCK = 2 // Non-blocking operations. -}; +#define NNG_FLAG_ALLOC 1u // Recv to allocate receive buffer +#define NNG_FLAG_NONBLOCK 2u // Non-blocking operations // Options. #define NNG_OPT_SOCKNAME "socket-name" -- cgit v1.2.3-70-g09d2