summaryrefslogtreecommitdiff
path: root/src/or/consdiffmgr.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-12-08 14:58:43 -0500
committerNick Mathewson <nickm@torproject.org>2017-12-08 14:58:43 -0500
commit5ee0cccd49e57fad8c810e817d912d4a61dbc96c (patch)
tree2aa4d71a332805bcb1bf7746887e7435ffdc51f4 /src/or/consdiffmgr.c
parent44010c6fc11608b13924372a179825946672cb23 (diff)
parent7ca5f4bf0365b853cdb0bab5cc9cb0ce6deaec26 (diff)
downloadtor-5ee0cccd49e57fad8c810e817d912d4a61dbc96c.tar.gz
tor-5ee0cccd49e57fad8c810e817d912d4a61dbc96c.zip
Merge branch 'macro_free_v2_squashed'
Diffstat (limited to 'src/or/consdiffmgr.c')
-rw-r--r--src/or/consdiffmgr.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/or/consdiffmgr.c b/src/or/consdiffmgr.c
index e539b61484..38d901a3ae 100644
--- a/src/or/consdiffmgr.c
+++ b/src/or/consdiffmgr.c
@@ -207,9 +207,12 @@ HT_PROTOTYPE(cdm_diff_ht, cdm_diff_t, node, cdm_diff_hash, cdm_diff_eq)
HT_GENERATE2(cdm_diff_ht, cdm_diff_t, node, cdm_diff_hash, cdm_diff_eq,
0.6, tor_reallocarray, tor_free_)
+#define cdm_diff_free(diff) \
+ FREE_AND_NULL(cdm_diff_t, cdm_diff_free_, (diff))
+
/** Release all storage held in <b>diff</b>. */
static void
-cdm_diff_free(cdm_diff_t *diff)
+cdm_diff_free_(cdm_diff_t *diff)
{
if (!diff)
return;
@@ -1506,11 +1509,15 @@ consensus_diff_worker_threadfn(void *state_, void *work_)
return WQ_RPL_REPLY;
}
+#define consensus_diff_worker_job_free(job) \
+ FREE_AND_NULL(consensus_diff_worker_job_t, \
+ consensus_diff_worker_job_free_, (job))
+
/**
* Helper: release all storage held in <b>job</b>.
*/
static void
-consensus_diff_worker_job_free(consensus_diff_worker_job_t *job)
+consensus_diff_worker_job_free_(consensus_diff_worker_job_t *job)
{
if (!job)
return;
@@ -1658,11 +1665,15 @@ typedef struct consensus_compress_worker_job_t {
compressed_result_t out[ARRAY_LENGTH(compress_consensus_with)];
} consensus_compress_worker_job_t;
+#define consensus_compress_worker_job_free(job) \
+ FREE_AND_NULL(consensus_compress_worker_job_t, \
+ consensus_compress_worker_job_free_, (job))
+
/**
* Free all resources held in <b>job</b>
*/
static void
-consensus_compress_worker_job_free(consensus_compress_worker_job_t *job)
+consensus_compress_worker_job_free_(consensus_compress_worker_job_t *job)
{
if (!job)
return;