aboutsummaryrefslogtreecommitdiff
path: root/llex.c
diff options
context:
space:
mode:
Diffstat (limited to 'llex.c')
-rw-r--r--llex.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/llex.c b/llex.c
index b2560fbd..6a467759 100644
--- a/llex.c
+++ b/llex.c
@@ -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) \