BBlack has submitted this change and it was merged. Change subject: wrap complex assert funcs in NDEBUG checks ......................................................................
wrap complex assert funcs in NDEBUG checks Change-Id: Id3e3e561b790162bacb66ea4a308fceef6cdb78e --- M src/purger.c M src/strq.c 2 files changed, 16 insertions(+), 0 deletions(-) Approvals: Ori.livneh: Looks good to me, but someone else must approve BBlack: Verified; Looks good to me, approved diff --git a/src/purger.c b/src/purger.c index 0bde22a..796eb84 100644 --- a/src/purger.c +++ b/src/purger.c @@ -192,6 +192,12 @@ .on_message_complete = msg_complete_cb }; +#ifdef NDEBUG + +#define purger_assert_sanity(x) ((void)(0)) + +#else + // Obviously, these assertions aren't always true mid-function // while transitioning from one state to another. They're the // states we should be in when we return to the eventloop, and @@ -265,6 +271,8 @@ } } +#endif + // The fixed parts of the request string. // The two holes are for the URL and the hostname. static const char out_prefix[] = "PURGE "; diff --git a/src/strq.c b/src/strq.c index bc2714d..a3e6675 100644 --- a/src/strq.c +++ b/src/strq.c @@ -82,6 +82,12 @@ ev_timer* reclaim_timer; }; +#ifdef NDEBUG + +#define assert_queue_sane(x) ((void)(0)) + +#else + static void assert_queue_sane(strq_t* q) { dmn_assert(q); dmn_assert(q->q_size < q->q_alloc); @@ -113,6 +119,8 @@ dmn_assert(one_vhead_is_head); } +#endif + static void reclaim_cb(struct ev_loop* loop, ev_timer* w, int revents); strq_t* strq_new(struct ev_loop* loop, unsigned max_mb, unsigned num_vheads) { -- To view, visit https://gerrit.wikimedia.org/r/265806 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id3e3e561b790162bacb66ea4a308fceef6cdb78e Gerrit-PatchSet: 1 Gerrit-Project: operations/software/varnish/vhtcpd Gerrit-Branch: master Gerrit-Owner: BBlack <bbl...@wikimedia.org> Gerrit-Reviewer: BBlack <bbl...@wikimedia.org> Gerrit-Reviewer: Ori.livneh <o...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits