diff options
| author | Garrett D'Amore <garrett@damore.org> | 2017-01-02 11:26:43 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2017-01-02 11:26:43 -0800 |
| commit | c3d8e75f2bb76b5bfafc589f860036cf42cfbaa0 (patch) | |
| tree | 44c6cf24785864b4b83adb0fad9ec2b51f67d862 /src/core/pipe.c | |
| parent | b921ef8889a86cce42bca28950e33ba11d28d78f (diff) | |
| download | nng-c3d8e75f2bb76b5bfafc589f860036cf42cfbaa0.tar.gz nng-c3d8e75f2bb76b5bfafc589f860036cf42cfbaa0.tar.bz2 nng-c3d8e75f2bb76b5bfafc589f860036cf42cfbaa0.zip | |
Use new NNI_ALLOC_STRUCT macro. nni_msg_dup copies options too.
Diffstat (limited to 'src/core/pipe.c')
| -rw-r--r-- | src/core/pipe.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/core/pipe.c b/src/core/pipe.c index 34db782a..177216bd 100644 --- a/src/core/pipe.c +++ b/src/core/pipe.c @@ -79,7 +79,7 @@ nni_pipe_destroy(nni_pipe *p) if (p->p_pdata != NULL) { nni_free(p->p_pdata, p->p_psize); } - nni_free(p, sizeof (*p)); + NNI_FREE_STRUCT(p); } @@ -91,7 +91,7 @@ nni_pipe_create(nni_pipe **pp, nni_endpt *ep) nni_protocol *proto = &sock->s_ops; int rv; - if ((p = nni_alloc(sizeof (*p))) == NULL) { + if ((p = NNI_ALLOC_STRUCT(p)) == NULL) { return (NNG_ENOMEM); } p->p_sock = sock; @@ -102,20 +102,20 @@ nni_pipe_create(nni_pipe **pp, nni_endpt *ep) NNI_LIST_NODE_INIT(&p->p_node); if ((p->p_pdata = nni_alloc(p->p_psize)) == NULL) { - nni_free(p, sizeof (*p)); + NNI_FREE_STRUCT(p); return (NNG_ENOMEM); } rv = nni_thr_init(&p->p_recv_thr, proto->proto_pipe_recv, p->p_pdata); if (rv != 0) { nni_free(p->p_pdata, p->p_psize); - nni_free(p, sizeof (*p)); + NNI_FREE_STRUCT(p); return (rv); } rv = nni_thr_init(&p->p_send_thr, proto->proto_pipe_send, p->p_pdata); if (rv != 0) { nni_thr_fini(&p->p_recv_thr); nni_free(p->p_pdata, p->p_psize); - nni_free(p, sizeof (*p)); + NNI_FREE_STRUCT(p); return (rv); } p->p_psize = sock->s_ops.proto_pipe_size; |
