aboutsummaryrefslogtreecommitdiff
path: root/ldo.h
diff options
context:
space:
mode:
Diffstat (limited to 'ldo.h')
-rw-r--r--ldo.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/ldo.h b/ldo.h
index b2065cfa..4717620f 100644
--- a/ldo.h
+++ b/ldo.h
@@ -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' */
37typedef void (*Pfunc) (lua_State *L, void *ud); 45typedef void (*Pfunc) (lua_State *L, void *ud);
38 46