From 57e5c8bb2ee122c30fa14127c3b969dc858491c0 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sat, 25 Dec 2021 13:14:26 -0800 Subject: Pollables can be completely inline. This eliminates more failure paths, and brings us still closer to eliminating the possibility of failure during socket init. --- src/core/pollable.c | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) (limited to 'src/core/pollable.c') diff --git a/src/core/pollable.c b/src/core/pollable.c index fb6af0f5..8e5ad7c1 100644 --- a/src/core/pollable.c +++ b/src/core/pollable.c @@ -1,5 +1,5 @@ // -// Copyright 2020 Staysail Systems, Inc. +// Copyright 2021 Staysail Systems, Inc. // Copyright 2018 Capitar IT Group BV // // This software is supplied under the terms of the MIT License, a @@ -38,34 +38,9 @@ nni_pollable_fini(nni_pollable *p) } } -int -nni_pollable_alloc(nni_pollable **pp) -{ - nni_pollable *p; - if ((p = NNI_ALLOC_STRUCT(p)) == NULL) { - return (NNG_ENOMEM); - } - nni_pollable_init(p); - *pp = p; - return (0); -} - -void -nni_pollable_free(nni_pollable *p) -{ - if (p == NULL) { - return; - } - nni_pollable_fini(p); - NNI_FREE_STRUCT(p); -} - void nni_pollable_raise(nni_pollable *p) { - if (p == NULL) { - return; - } if (!nni_atomic_swap_bool(&p->p_raised, true)) { uint64_t fds; if ((fds = nni_atomic_get64(&p->p_fds)) != (uint64_t) -1) { @@ -77,9 +52,6 @@ nni_pollable_raise(nni_pollable *p) void nni_pollable_clear(nni_pollable *p) { - if (p == NULL) { - return; - } if (nni_atomic_swap_bool(&p->p_raised, false)) { uint64_t fds; if ((fds = nni_atomic_get64(&p->p_fds)) != (uint64_t) -1) { -- cgit v1.2.3-70-g09d2