diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-10-09 10:00:08 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-10-09 10:00:08 -0300 |
commit | e1d5153a33d278ac9db18f5bcc142a75e48606de (patch) | |
tree | 4d781bab59bb2d27ddd3f9ff2c3928a7f0b1f2bc | |
parent | b3d0682fb94f56a438dbb4fdb2b3440ccc10cfb4 (diff) | |
download | lua-e1d5153a33d278ac9db18f5bcc142a75e48606de.tar.gz lua-e1d5153a33d278ac9db18f5bcc142a75e48606de.tar.bz2 lua-e1d5153a33d278ac9db18f5bcc142a75e48606de.zip |
details
-rw-r--r-- | llex.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: llex.c,v 1.112 2002/09/19 13:03:53 roberto Exp roberto $ | 2 | ** $Id: llex.c,v 1.113 2002/10/08 18:46:08 roberto Exp roberto $ |
3 | ** Lexical Analyzer | 3 | ** Lexical Analyzer |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -136,11 +136,16 @@ void luaX_setinput (lua_State *L, LexState *LS, ZIO *z, TString *source) { | |||
136 | */ | 136 | */ |
137 | 137 | ||
138 | 138 | ||
139 | /* use Mbuffer to store names, literal strings and numbers */ | 139 | /* use buffer to store names, literal strings and numbers */ |
140 | 140 | ||
141 | /* extra space to allocate when growing buffer */ | ||
141 | #define EXTRABUFF 32 | 142 | #define EXTRABUFF 32 |
143 | |||
144 | /* maximum number of chars that can be read without checking buffer size */ | ||
145 | #define MAXNOCHECK 5 | ||
146 | |||
142 | #define checkbuffer(LS, len) \ | 147 | #define checkbuffer(LS, len) \ |
143 | if (((len)+3)*sizeof(char) > luaZ_sizebuffer((LS)->buff)) \ | 148 | if (((len)+MAXNOCHECK)*sizeof(char) > luaZ_sizebuffer((LS)->buff)) \ |
144 | luaZ_openspace((LS)->L, (LS)->buff, (len)+EXTRABUFF) | 149 | luaZ_openspace((LS)->L, (LS)->buff, (len)+EXTRABUFF) |
145 | 150 | ||
146 | #define save(LS, c, l) \ | 151 | #define save(LS, c, l) \ |