From fb1d6005973c1b83d8385b606abb139c59718780 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Wed, 29 Jan 2020 03:29:42 +0300 Subject: [PATCH] mdbx: speedup debug/checked build. This resolves https://github.com/leo-yuriev/libmdbx/issues/80 Change-Id: I20596f87db17ce01379dae5f58f4c2b158a04a4a --- src/elements/core.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/elements/core.c b/src/elements/core.c index c3e2ca24..fc6c646d 100644 --- a/src/elements/core.c +++ b/src/elements/core.c @@ -2488,8 +2488,10 @@ static int lcklist_detach_locked(MDBX_env *env) { } \ } \ \ - for (TYPE *scan = begin + 1; scan < end; ++scan) \ - assert(CMP(scan[-1], scan[0])); \ + if (mdbx_audit_enabled()) { \ + for (TYPE *scan = begin + 1; scan < end; ++scan) \ + assert(CMP(scan[-1], scan[0])); \ + } \ } /*------------------------------------------------------------------------------ @@ -2528,11 +2530,13 @@ static int lcklist_detach_locked(MDBX_env *env) { ++first; \ } \ \ - for (TYPE_LIST *scan = begin; scan < first; ++scan) \ - assert(CMP(*scan, item)); \ - for (TYPE_LIST *scan = first; scan < end; ++scan) \ - assert(!CMP(*scan, item)); \ - (void)begin, (void)end; \ + if (mdbx_audit_enabled()) { \ + for (TYPE_LIST *scan = begin; scan < first; ++scan) \ + assert(CMP(*scan, item)); \ + for (TYPE_LIST *scan = first; scan < end; ++scan) \ + assert(!CMP(*scan, item)); \ + (void)begin, (void)end; \ + } \ \ return first; \ }