diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-05-13 10:04:33 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-05-13 10:04:33 -0300 |
commit | 5c8770f8969a73cf4ca503f54c2217f76de62e04 (patch) | |
tree | d5dac87490011d117277d94c81f6f2fd47b1b094 /ldo.h | |
parent | 7647d5d13d016f114dac4be0b9da62d502eab400 (diff) | |
download | lua-5c8770f8969a73cf4ca503f54c2217f76de62e04.tar.gz lua-5c8770f8969a73cf4ca503f54c2217f76de62e04.tar.bz2 lua-5c8770f8969a73cf4ca503f54c2217f76de62e04.zip |
back to old-style vararg system (with vararg table collecting extra
arguments)
Diffstat (limited to 'ldo.h')
-rw-r--r-- | ldo.h | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldo.h,v 2.28 2015/11/23 11:29:43 roberto Exp roberto $ | 2 | ** $Id: ldo.h,v 2.29 2015/12/21 13:02:14 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 | */ |
@@ -33,6 +33,14 @@ | |||
33 | #define restorestack(L,n) ((TValue *)((char *)L->stack + (n))) | 33 | #define restorestack(L,n) ((TValue *)((char *)L->stack + (n))) |
34 | 34 | ||
35 | 35 | ||
36 | /* macro to check stack size, preserving 'p' */ | ||
37 | #define checkstackp(L,n,p) \ | ||
38 | luaD_checkstackaux(L, n, \ | ||
39 | ptrdiff_t t__ = savestack(L, p); /* save 'p' */ \ | ||
40 | luaC_checkGC(L), /* stack grow uses memory */ \ | ||
41 | p = restorestack(L, t__)) /* 'pos' part: restore 'p' */ | ||
42 | |||
43 | |||
36 | /* type of protected functions, to be ran by 'runprotected' */ | 44 | /* type of protected functions, to be ran by 'runprotected' */ |
37 | typedef void (*Pfunc) (lua_State *L, void *ud); | 45 | typedef void (*Pfunc) (lua_State *L, void *ud); |
38 | 46 | ||