summaryrefslogtreecommitdiffstats
path: root/generic/regguts.h
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2016-02-01 21:39:44 (GMT)
committerdgp <dgp@users.sourceforge.net>2016-02-01 21:39:44 (GMT)
commit05a77f3559bff860de052d23fb8cdefdadd53b3c (patch)
tree16052ddae9882ca469926312bf68f818326dc171 /generic/regguts.h
parent4dfcbbea544e672812bc7d4de3b7571e14cccc22 (diff)
downloadtcl-05a77f3559bff860de052d23fb8cdefdadd53b3c.zip
tcl-05a77f3559bff860de052d23fb8cdefdadd53b3c.tar.gz
tcl-05a77f3559bff860de052d23fb8cdefdadd53b3c.tar.bz2
Backout the contributed patch memaccounting from Postgres since it changes
the protections incompatibly and causes established tests to crash.
Diffstat (limited to 'generic/regguts.h')
-rw-r--r--generic/regguts.h16
1 files changed, 7 insertions, 9 deletions
diff --git a/generic/regguts.h b/generic/regguts.h
index 72bdcb3..7ed8ec1 100644
--- a/generic/regguts.h
+++ b/generic/regguts.h
@@ -307,6 +307,9 @@ struct nfa {
struct colormap *cm; /* the color map */
color bos[2]; /* colors, if any, assigned to BOS and BOL */
color eos[2]; /* colors, if any, assigned to EOS and EOL */
+ size_t size; /* Current NFA size; differs from nstates as
+ * it also counts the number of states created
+ * by children of this state. */
struct vars *v; /* simplifies compile error reporting */
struct nfa *parent; /* parent NFA, if any */
};
@@ -336,16 +339,11 @@ struct cnfa {
#define NULLCNFA(cnfa) ((cnfa).nstates == 0)
/*
- * This symbol limits the transient heap space used by the regex compiler,
- * and thereby also the maximum complexity of NFAs that we'll deal with.
- * Currently we only count NFA states and arcs against this; the other
- * transient data is generally not large enough to notice compared to those.
- * Note that we do not charge anything for the final output data structures
- * (the compacted NFA and the colormap).
+ * Used to limit the maximum NFA size to something sane. [Bug 1810264]
*/
-#ifndef REG_MAX_COMPILE_SPACE
-#define REG_MAX_COMPILE_SPACE \
- (100000 * sizeof(struct state) + 100000 * sizeof(struct arcbatch))
+
+#ifndef REG_MAX_STATES
+# define REG_MAX_STATES 100000
#endif
/*