summaryrefslogtreecommitdiffstats
path: root/generic/regguts.h
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2007-01-10 15:30:59 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2007-01-10 15:30:59 (GMT)
commitf299701a39e378d072a5c5d97396675ce735b414 (patch)
treea89fe1c2a582e5bc126b2ec3cf259c3c61a28a55 /generic/regguts.h
parent0461303eb629c1a59984468e671be1d59c424aae (diff)
downloadtcl-f299701a39e378d072a5c5d97396675ce735b414.zip
tcl-f299701a39e378d072a5c5d97396675ce735b414.tar.gz
tcl-f299701a39e378d072a5c5d97396675ce735b414.tar.bz2
Arrange for RE engine workspace to be held in TSD. This is safe, less
C-stack-hungry than before, and faster than just using heap allocation.
Diffstat (limited to 'generic/regguts.h')
-rw-r--r--generic/regguts.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/generic/regguts.h b/generic/regguts.h
index 190d40b..991979e 100644
--- a/generic/regguts.h
+++ b/generic/regguts.h
@@ -399,6 +399,19 @@ struct guts {
struct subre *lacons; /* lookahead-constraint vector */
int nlacons; /* size of lacons */
};
+
+/*
+ * Magic for allocating a variable workspace.
+ */
+
+#ifndef AllocVars
+#define AllocVars(vPtr) \
+ struct vars var; \
+ register struct vars *vPtr = &var
+#endif
+#ifndef FreeVars
+#define FreeVars(vPtr) ((void) 0)
+#endif
/*
* Local Variables: