summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2015-11-22 21:02:29 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2015-11-22 21:02:29 (GMT)
commit5eeef96ee9e6fbb573a438338662fea9ca7c0efd (patch)
tree251cb02566078f3add782ab598462b1054586426
parent6b4bc6bb8d46722088d73bd4a93f51e7fc65dbf4 (diff)
downloadtcl-5eeef96ee9e6fbb573a438338662fea9ca7c0efd.zip
tcl-5eeef96ee9e6fbb573a438338662fea9ca7c0efd.tar.gz
tcl-5eeef96ee9e6fbb573a438338662fea9ca7c0efd.tar.bz2
Cherrypick [812a81812ebf89d2416059d45fabd27e45603f5e|812a81812e]: Turn off NRE asserts by default. About a 5% speedup on [clock format].
-rw-r--r--generic/regc_nfa.c12
-rw-r--r--generic/tclBasic.c3
-rw-r--r--generic/tclExecute.c3
-rw-r--r--generic/tclInt.h4
4 files changed, 9 insertions, 13 deletions
diff --git a/generic/regc_nfa.c b/generic/regc_nfa.c
index 0e0343e..088c6c0 100644
--- a/generic/regc_nfa.c
+++ b/generic/regc_nfa.c
@@ -293,7 +293,7 @@ newarc(
}
}
}
-
+
/* no dup, so create the arc */
createarc(nfa, t, co, from, to);
}
@@ -657,7 +657,7 @@ sortins_cmp(
}
return 0;
}
-
+
/*
* sortouts - sort the out arcs of a state by to/color/type
*/
@@ -2020,7 +2020,7 @@ fixempties(
arcarray[arccount++] = a;
}
}
-
+
/* Reset the tmp fields as we walk back */
nexts = s2->tmp;
s2->tmp = NULL;
@@ -2042,7 +2042,7 @@ fixempties(
}
inarcsorig[s->no] = a;
}
-
+
FREE(arcarray);
FREE(inarcsorig);
@@ -2193,7 +2193,7 @@ fixconstraintloops(
dropstate(nfa, s);
}
}
-
+
/* Nothing to do if no remaining constraint arcs */
if (NISERR() || !hasconstraints) {
return;
@@ -2909,7 +2909,7 @@ carc_cmp(
{
const struct carc *aa = (const struct carc *) a;
const struct carc *bb = (const struct carc *) b;
-
+
if (aa->co < bb->co) {
return -1;
}
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index a09bf10..5c5bc64 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -22,10 +22,7 @@
#include "tclCompile.h"
#include "tommath.h"
#include <math.h>
-
-#if NRE_ENABLE_ASSERTS
#include <assert.h>
-#endif
#define INTERP_STACK_INITIAL_SIZE 2000
#define CORO_STACK_INITIAL_SIZE 200
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 7f65262..b10af65 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -20,10 +20,7 @@
#include "tclOOInt.h"
#include "tommath.h"
#include <math.h>
-
-#if NRE_ENABLE_ASSERTS
#include <assert.h>
-#endif
/*
* Hack to determine whether we may expect IEEE floating point. The hack is
diff --git a/generic/tclInt.h b/generic/tclInt.h
index f9d2edf..082fab4 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -4791,7 +4791,9 @@ void Tcl_Panic(const char *, ...) __attribute__((analyzer_noreturn));
*/
#define NRE_USE_SMALL_ALLOC 1 /* Only turn off for debugging purposes. */
-#define NRE_ENABLE_ASSERTS 1
+#ifndef NRE_ENABLE_ASSERTS
+#define NRE_ENABLE_ASSERTS 0
+#endif
/*
* This is the main data struct for representing NR commands. It is designed