aboutsummaryrefslogtreecommitdiff
path: root/lapi.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2000-02-22 15:54:16 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2000-02-22 15:54:16 -0200
commit5cecf0ea9f14d9ea5363654c429c3fd7d2c0e1a7 (patch)
tree5f2e93f059320e1a7e127e095c47c9f2f7c3dd72 /lapi.c
parent3bc925138ebcb534f863b3fb32b21eb8d52aa915 (diff)
downloadlua-5cecf0ea9f14d9ea5363654c429c3fd7d2c0e1a7.tar.gz
lua-5cecf0ea9f14d9ea5363654c429c3fd7d2c0e1a7.tar.bz2
lua-5cecf0ea9f14d9ea5363654c429c3fd7d2c0e1a7.zip
it is better to control stack space where it is needed.
Diffstat (limited to 'lapi.c')
-rw-r--r--lapi.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/lapi.c b/lapi.c
index 427cf3ab..01579561 100644
--- a/lapi.c
+++ b/lapi.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lapi.c,v 1.70 2000/01/24 20:14:07 roberto Exp roberto $ 2** $Id: lapi.c,v 1.71 2000/02/08 16:34:31 roberto Exp roberto $
3** Lua API 3** Lua API
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -142,7 +142,6 @@ lua_Object lua_rawgettable (lua_State *L) {
142void lua_settable (lua_State *L) { 142void lua_settable (lua_State *L) {
143 StkId top; 143 StkId top;
144 luaA_checkCparams(L, 3); 144 luaA_checkCparams(L, 3);
145 luaD_checkstack(L, 3); /* may need that to call a tag method */
146 top = L->top; 145 top = L->top;
147 luaV_settable(L, top-3, top); 146 luaV_settable(L, top-3, top);
148 L->top = top-3; /* pop table, index, and value */ 147 L->top = top-3; /* pop table, index, and value */
@@ -165,7 +164,6 @@ lua_Object lua_createtable (lua_State *L) {
165 164
166 165
167lua_Object lua_getglobal (lua_State *L, const char *name) { 166lua_Object lua_getglobal (lua_State *L, const char *name) {
168 luaD_checkstack(L, 3); /* may need that to call a tag method */
169 luaV_getglobal(L, luaS_assertglobalbyname(L, name), L->top++); 167 luaV_getglobal(L, luaS_assertglobalbyname(L, name), L->top++);
170 return luaA_putObjectOnTop(L); 168 return luaA_putObjectOnTop(L);
171} 169}
@@ -179,7 +177,6 @@ lua_Object lua_rawgetglobal (lua_State *L, const char *name) {
179 177
180void lua_setglobal (lua_State *L, const char *name) { 178void lua_setglobal (lua_State *L, const char *name) {
181 luaA_checkCparams(L, 1); 179 luaA_checkCparams(L, 1);
182 luaD_checkstack(L, 3); /* may need that to call a tag method */
183 luaV_setglobal(L, luaS_assertglobalbyname(L, name), L->top--); 180 luaV_setglobal(L, luaS_assertglobalbyname(L, name), L->top--);
184} 181}
185 182