summaryrefslogtreecommitdiff
path: root/src/core/msgqueue.c
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/core/msgqueue.c
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/core/msgqueue.c')
-rw-r--r--src/core/msgqueue.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/msgqueue.c b/src/core/msgqueue.c
index ba6aa6bb..4807fe0f 100644
--- a/src/core/msgqueue.c
+++ b/src/core/msgqueue.c
@@ -48,7 +48,7 @@ nni_msgqueue_create(nni_msgqueue **mqp, int cap)
// a message back at the end to do a retry.
alloc = cap + 2;
- if ((mq = nni_alloc(sizeof (*mq))) == NULL) {
+ if ((mq = NNI_ALLOC_STRUCT(mq)) == NULL) {
return (NNG_ENOMEM);
}
if ((rv = nni_mtx_init(&mq->mq_lock)) != 0) {
@@ -113,7 +113,7 @@ nni_msgqueue_destroy(nni_msgqueue *mq)
}
nni_free(mq->mq_msgs, mq->mq_alloc * sizeof (nng_msg *));
- nni_free(mq, sizeof (*mq));
+ NNI_FREE_STRUCT(mq);
}