diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-10-27 14:29:58 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-10-27 14:29:58 -0200 |
| commit | 491103708e5516c94fa3e1af0af3a52065c40959 (patch) | |
| tree | 8b3cf176ff09d74fb3e6045f29344a8fcfc4cb42 | |
| parent | fa4d5c86895fa176c4d7435a23d48a053b15b176 (diff) | |
| download | lua-491103708e5516c94fa3e1af0af3a52065c40959.tar.gz lua-491103708e5516c94fa3e1af0af3a52065c40959.tar.bz2 lua-491103708e5516c94fa3e1af0af3a52065c40959.zip | |
'MAXSTACK' -> 'MAXREGS' and moved to 'lcode.c' (there is no reason
to change that constant...)
| -rw-r--r-- | lcode.c | 8 | ||||
| -rw-r--r-- | llimits.h | 6 |
2 files changed, 7 insertions, 7 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lcode.c,v 2.90 2014/05/08 18:58:46 roberto Exp roberto $ | 2 | ** $Id: lcode.c,v 2.91 2014/10/25 11:50:46 roberto Exp roberto $ |
| 3 | ** Code generator for Lua | 3 | ** Code generator for Lua |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -27,6 +27,10 @@ | |||
| 27 | #include "lvm.h" | 27 | #include "lvm.h" |
| 28 | 28 | ||
| 29 | 29 | ||
| 30 | /* Maximum number of registers in a Lua function */ | ||
| 31 | #define MAXREGS 250 | ||
| 32 | |||
| 33 | |||
| 30 | /* test for x == -0 */ | 34 | /* test for x == -0 */ |
| 31 | #if defined(signbit) | 35 | #if defined(signbit) |
| 32 | #define isminuszero(x) ((x) == 0.0 && signbit(x)) | 36 | #define isminuszero(x) ((x) == 0.0 && signbit(x)) |
| @@ -280,7 +284,7 @@ int luaK_codek (FuncState *fs, int reg, int k) { | |||
| 280 | void luaK_checkstack (FuncState *fs, int n) { | 284 | void luaK_checkstack (FuncState *fs, int n) { |
| 281 | int newstack = fs->freereg + n; | 285 | int newstack = fs->freereg + n; |
| 282 | if (newstack > fs->f->maxstacksize) { | 286 | if (newstack > fs->f->maxstacksize) { |
| 283 | if (newstack >= MAXSTACK) | 287 | if (newstack >= MAXREGS) |
| 284 | luaX_syntaxerror(fs->ls, "function or expression too complex"); | 288 | luaX_syntaxerror(fs->ls, "function or expression too complex"); |
| 285 | fs->f->maxstacksize = cast_byte(newstack); | 289 | fs->f->maxstacksize = cast_byte(newstack); |
| 286 | } | 290 | } |
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: llimits.h,v 1.120 2014/07/18 18:29:12 roberto Exp roberto $ | 2 | ** $Id: llimits.h,v 1.121 2014/10/25 11:50:46 roberto Exp roberto $ |
| 3 | ** Limits, basic types, and some other 'installation-dependent' definitions | 3 | ** Limits, basic types, and some other 'installation-dependent' definitions |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -156,10 +156,6 @@ typedef lu_int32 Instruction; | |||
| 156 | 156 | ||
| 157 | 157 | ||
| 158 | 158 | ||
| 159 | /* maximum stack for a Lua function */ | ||
| 160 | #define MAXSTACK 250 | ||
| 161 | |||
| 162 | |||
| 163 | 159 | ||
| 164 | /* minimum size for the string table (must be power of 2) */ | 160 | /* minimum size for the string table (must be power of 2) */ |
| 165 | #if !defined(MINSTRTABSIZE) | 161 | #if !defined(MINSTRTABSIZE) |
