aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2015-10-28 10:25:36 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2015-10-28 10:25:36 -0200
commitae515a346ca6422750b985a68975fb4bd9de7be9 (patch)
tree15618c4746bdfe9dfeec89aee3a3af2328b41f40
parent3cdf1d676bc5a2431a49036dd3f6412d6913aa2a (diff)
downloadlua-ae515a346ca6422750b985a68975fb4bd9de7be9.tar.gz
lua-ae515a346ca6422750b985a68975fb4bd9de7be9.tar.bz2
lua-ae515a346ca6422750b985a68975fb4bd9de7be9.zip
comments for luaD_precall/luaD_poscall
-rw-r--r--ldo.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/ldo.c b/ldo.c
index 123c1194..564bacd4 100644
--- a/ldo.c
+++ b/ldo.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldo.c,v 2.141 2015/10/21 18:40:47 roberto Exp roberto $ 2** $Id: ldo.c,v 2.142 2015/10/28 12:06:45 roberto Exp roberto $
3** Stack and Call structure of Lua 3** Stack and Call structure of Lua
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -315,8 +315,13 @@ static void tryfuncTM (lua_State *L, StkId func) {
315 luaC_checkGC(L), /* stack grow uses memory */ \ 315 luaC_checkGC(L), /* stack grow uses memory */ \
316 p = restorestack(L, t__)) /* 'pos' part: restore 'p' */ 316 p = restorestack(L, t__)) /* 'pos' part: restore 'p' */
317 317
318
318/* 319/*
319** returns true if function has been executed (C function) 320** Prepares a function call: checks the stack, creates a new CallInfo
321** entry, fills in the relevant information, calls hook if needed.
322** If function is a C function, does the call, too. (Otherwise, leave
323** the execution ('luaV_execute') to the caller, to allow stackless
324** calls.) Returns true iff function has been executed (C function).
320*/ 325*/
321int luaD_precall (lua_State *L, StkId func, int nresults) { 326int luaD_precall (lua_State *L, StkId func, int nresults) {
322 lua_CFunction f; 327 lua_CFunction f;
@@ -381,6 +386,11 @@ int luaD_precall (lua_State *L, StkId func, int nresults) {
381} 386}
382 387
383 388
389/*
390** Finishes a function call: calls hook if necessary, removes CallInfo,
391** moves corrent number of results to proper place; returns 0 iff call
392** wanted multiple (variable number of) results.
393*/
384int luaD_poscall (lua_State *L, StkId firstResult, int nres) { 394int luaD_poscall (lua_State *L, StkId firstResult, int nres) {
385 StkId res; 395 StkId res;
386 int wanted, i; 396 int wanted, i;