aboutsummaryrefslogtreecommitdiff
path: root/lstate.h
diff options
context:
space:
mode:
Diffstat (limited to 'lstate.h')
-rw-r--r--lstate.h20
1 files changed, 4 insertions, 16 deletions
diff --git a/lstate.h b/lstate.h
index 37de2372..009ea790 100644
--- a/lstate.h
+++ b/lstate.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstate.h,v 1.109 2003/02/27 11:52:30 roberto Exp roberto $ 2** $Id: lstate.h,v 1.110 2003/04/28 19:26:16 roberto Exp roberto $
3** Global State 3** Global State
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -75,11 +75,9 @@ typedef struct stringtable {
75typedef struct CallInfo { 75typedef struct CallInfo {
76 StkId base; /* base for called function */ 76 StkId base; /* base for called function */
77 StkId top; /* top for this function */ 77 StkId top; /* top for this function */
78 int state; /* bit fields; see below */
79 union { 78 union {
80 struct { /* for Lua functions */ 79 struct { /* for Lua functions */
81 const Instruction *savedpc; 80 const Instruction *savedpc;
82 const Instruction **pc; /* points to `pc' variable in `luaV_execute' */
83 int tailcalls; /* number of tail calls lost under this entry */ 81 int tailcalls; /* number of tail calls lost under this entry */
84 } l; 82 } l;
85 struct { /* for C functions */ 83 struct { /* for C functions */
@@ -89,20 +87,10 @@ typedef struct CallInfo {
89} CallInfo; 87} CallInfo;
90 88
91 89
92/*
93** bit fields for `CallInfo.state'
94*/
95#define CI_C (1<<0) /* 1 if function is a C function */
96/* 1 if (Lua) function has an active `luaV_execute' running it */
97#define CI_HASFRAME (1<<1)
98/* 1 if Lua function is calling another Lua function (and therefore its
99 `pc' is being used by the other, and therefore CI_SAVEDPC is 1 too) */
100#define CI_CALLING (1<<2)
101#define CI_SAVEDPC (1<<3) /* 1 if `savedpc' is updated */
102#define CI_YIELD (1<<4) /* 1 if thread is suspended */
103
104 90
105#define ci_func(ci) (clvalue((ci)->base - 1)) 91#define ci_func(ci) (clvalue((ci)->base - 1))
92#define f_isLua(ci) (!ci_func(ci)->c.isC)
93#define isLua(ci) (ttisfunction((ci)->base - 1) && f_isLua(ci))
106 94
107 95
108/* 96/*
@@ -143,7 +131,7 @@ struct lua_State {
143 unsigned short nCcalls; /* number of nested C calls */ 131 unsigned short nCcalls; /* number of nested C calls */
144 lu_byte hookmask; 132 lu_byte hookmask;
145 lu_byte allowhook; 133 lu_byte allowhook;
146 lu_byte hookinit; 134 lu_byte isSuspended;
147 int basehookcount; 135 int basehookcount;
148 int hookcount; 136 int hookcount;
149 lua_Hook hook; 137 lua_Hook hook;