diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2007-01-10 15:30:59 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2007-01-10 15:30:59 (GMT) |
commit | f299701a39e378d072a5c5d97396675ce735b414 (patch) | |
tree | a89fe1c2a582e5bc126b2ec3cf259c3c61a28a55 /generic/regguts.h | |
parent | 0461303eb629c1a59984468e671be1d59c424aae (diff) | |
download | tcl-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.h | 13 |
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: |