diff options
author | John Millaway <john43@users.sourceforge.net> | 2002-08-20 21:42:43 +0000 |
---|---|---|
committer | John Millaway <john43@users.sourceforge.net> | 2002-08-20 21:42:43 +0000 |
commit | 32b089c2248fb3969b8556ce56445bf1313caddb (patch) | |
tree | 2b54ecb8d2b5b5790133a17018ad682e498ab7ed /flex.skl | |
parent | 510a4b5844d37b249df8e91cdfb32a6c10399476 (diff) |
Dynamically allocate REJECT state buffer.
Mentioned memory usage in docs.
Made REJECT buffer variables reentrant-safe.
Diffstat (limited to 'flex.skl')
-rw-r--r-- | flex.skl | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -521,6 +521,13 @@ struct yyguts_t int yylineno_r; int yy_flex_debug_r; +#ifdef YY_USES_REJECT + yy_state_type *yy_state_buf; + yy_state_type *yy_state_ptr; + char *yy_full_match; + int yy_lp; +#endif + #ifdef YY_TEXT_IS_ARRAY char yytext_r[YYLMAX]; char *yytext_ptr; @@ -816,6 +823,11 @@ YY_DECL YY_USER_INIT; #endif +#ifdef YY_USES_REJECT + if ( ! YY_G(yy_state_buf) ) + YY_G(yy_state_buf) = yyalloc(YY_BUF_SIZE + 2 YY_CALL_LAST_ARG); +#endif + if ( ! YY_G(yy_start) ) YY_G(yy_start) = 1; /* first start state */ @@ -1969,6 +1981,10 @@ int yylex_destroy YYFARGS0(void) } #endif +#ifdef YY_USES_REJECT + yyfree ( YY_G(yy_state_buf) YY_CALL_LAST_ARG); +#endif + #ifdef YY_REENTRANT /* Destroy the main struct (reentrant only). */ yyfree ( yyscanner YY_CALL_LAST_ARG ); |