aboutsummaryrefslogtreecommitdiff
path: root/ldo.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2021-10-29 13:41:24 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2021-10-29 13:41:24 -0300
commit1fce5bea817de50e055a84c153a975f25bfcf493 (patch)
tree294645bf9a85557026d8c99d74c2eac50a74302e /ldo.h
parent3699446aaf5c7a07af028b1ae43cf52d2d4dda59 (diff)
downloadlua-1fce5bea817de50e055a84c153a975f25bfcf493.tar.gz
lua-1fce5bea817de50e055a84c153a975f25bfcf493.tar.bz2
lua-1fce5bea817de50e055a84c153a975f25bfcf493.zip
More uniform implementation for tail calls
'luaD_pretailcall' mimics 'luaD_precall', handling call metamethods and calling C functions directly. That makes the code in the interpreter loop simpler. This commit also goes back to emulating the tail call in 'luaD_precall' with a goto, as C compilers may not do proper tail calls and the C stack can overflow much sooner than the Lua stack (which grows as the metamethod is added to it).
Diffstat (limited to 'ldo.h')
-rw-r--r--ldo.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/ldo.h b/ldo.h
index 9fb772fe..911e67f6 100644
--- a/ldo.h
+++ b/ldo.h
@@ -58,7 +58,7 @@ LUAI_FUNC int luaD_protectedparser (lua_State *L, ZIO *z, const char *name,
58LUAI_FUNC void luaD_hook (lua_State *L, int event, int line, 58LUAI_FUNC void luaD_hook (lua_State *L, int event, int line,
59 int fTransfer, int nTransfer); 59 int fTransfer, int nTransfer);
60LUAI_FUNC void luaD_hookcall (lua_State *L, CallInfo *ci); 60LUAI_FUNC void luaD_hookcall (lua_State *L, CallInfo *ci);
61LUAI_FUNC void luaD_pretailcall (lua_State *L, CallInfo *ci, StkId func, int n); 61LUAI_FUNC int luaD_pretailcall (lua_State *L, CallInfo *ci, StkId func, int narg1, int delta);
62LUAI_FUNC CallInfo *luaD_precall (lua_State *L, StkId func, int nResults); 62LUAI_FUNC CallInfo *luaD_precall (lua_State *L, StkId func, int nResults);
63LUAI_FUNC void luaD_call (lua_State *L, StkId func, int nResults); 63LUAI_FUNC void luaD_call (lua_State *L, StkId func, int nResults);
64LUAI_FUNC void luaD_callnoyield (lua_State *L, StkId func, int nResults); 64LUAI_FUNC void luaD_callnoyield (lua_State *L, StkId func, int nResults);