aboutsummaryrefslogtreecommitdiff
path: root/src/protocol/pair
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2017-01-02 11:26:43 -0800
committerGarrett D'Amore <garrett@damore.org>2017-01-02 11:26:43 -0800
commitc3d8e75f2bb76b5bfafc589f860036cf42cfbaa0 (patch)
tree44c6cf24785864b4b83adb0fad9ec2b51f67d862 /src/protocol/pair
parentb921ef8889a86cce42bca28950e33ba11d28d78f (diff)
downloadnng-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/protocol/pair')
-rw-r--r--src/protocol/pair/pair.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/protocol/pair/pair.c b/src/protocol/pair/pair.c
index 9336af8c..6ca891f0 100644
--- a/src/protocol/pair/pair.c
+++ b/src/protocol/pair/pair.c
@@ -47,11 +47,11 @@ nni_pair_create(void **pairp, nni_socket *sock)
nni_pair_sock *pair;
int rv;
- if ((pair = nni_alloc(sizeof (*pair))) == NULL) {
+ if ((pair = NNI_ALLOC_STRUCT(pair)) == NULL) {
return (NNG_ENOMEM);
}
if ((rv = nni_mtx_init(&pair->mx)) != 0) {
- nni_free(pair, sizeof (*pair));
+ NNI_FREE_STRUCT(pair);
return (rv);
}
pair->sock = sock;
@@ -73,7 +73,7 @@ nni_pair_destroy(void *arg)
// the socket already shut us down, and we don't have any other
// threads that run.
nni_mtx_fini(&pair->mx);
- nni_free(pair, sizeof (*pair));
+ NNI_FREE_STRUCT(pair);
}