The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Macros | Typedefs | Functions
lstate.h File Reference
#include "lua.h"
#include "lobject.h"
#include "ltm.h"
#include "lzio.h"
Include dependency graph for lstate.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  stringtable
 
struct  CallInfo
 
struct  global_State
 
struct  lua_State
 
union  GCObject
 

Macros

#define EXTRA_STACK   5
 
#define BASIC_STACK_SIZE   (2*LUA_MINSTACK)
 
#define KGC_NORMAL   0
 
#define KGC_EMERGENCY   1 /* gc was forced by an allocation failure */
 
#define KGC_GEN   2 /* generational collection */
 
#define CIST_LUA   (1<<0) /* call is running a Lua function */
 
#define CIST_HOOKED   (1<<1) /* call is running a debug hook */
 
#define CIST_REENTRY
 
#define CIST_YIELDED   (1<<3) /* call reentered after suspension */
 
#define CIST_YPCALL   (1<<4) /* call is a yieldable protected call */
 
#define CIST_STAT   (1<<5) /* call has an error status (pcall) */
 
#define CIST_TAIL   (1<<6) /* call was tail called */
 
#define CIST_HOOKYIELD   (1<<7) /* last hook called yielded */
 
#define isLua(ci)   ((ci)->callstatus & CIST_LUA)
 
#define G(L)   (L->l_G)
 
#define gch(o)   (&(o)->gch)
 
#define rawgco2ts(o)   check_exp(novariant((o)->gch.tt) == LUA_TSTRING, &((o)->ts))
 
#define gco2ts(o)   (&rawgco2ts(o)->tsv)
 
#define rawgco2u(o)   check_exp((o)->gch.tt == LUA_TUSERDATA, &((o)->u))
 
#define gco2u(o)   (&rawgco2u(o)->uv)
 
#define gco2lcl(o)   check_exp((o)->gch.tt == LUA_TLCL, &((o)->cl.l))
 
#define gco2ccl(o)   check_exp((o)->gch.tt == LUA_TCCL, &((o)->cl.c))
 
#define gco2cl(o)   check_exp(novariant((o)->gch.tt) == LUA_TFUNCTION, &((o)->cl))
 
#define gco2t(o)   check_exp((o)->gch.tt == LUA_TTABLE, &((o)->h))
 
#define gco2p(o)   check_exp((o)->gch.tt == LUA_TPROTO, &((o)->p))
 
#define gco2uv(o)   check_exp((o)->gch.tt == LUA_TUPVAL, &((o)->uv))
 
#define gco2th(o)   check_exp((o)->gch.tt == LUA_TTHREAD, &((o)->th))
 
#define obj2gco(v)   (cast(GCObject *, (v)))
 
#define gettotalbytes(g)   ((g)->totalbytes + (g)->GCdebt)
 

Typedefs

typedef struct stringtable stringtable
 
typedef struct CallInfo CallInfo
 
typedef struct global_State global_State
 

Functions

LUAI_FUNC void luaE_setdebt (global_State *g, l_mem debt)
 
LUAI_FUNC void luaE_freethread (lua_State *L, lua_State *L1)
 
LUAI_FUNC CallInfoluaE_extendCI (lua_State *L)
 
LUAI_FUNC void luaE_freeCI (lua_State *L)
 

Macro Definition Documentation

#define BASIC_STACK_SIZE   (2*LUA_MINSTACK)

Definition at line 49 of file lstate.h.

Referenced by stack_init().

#define CIST_HOOKED   (1<<1) /* call is running a debug hook */

Definition at line 95 of file lstate.h.

Referenced by lua_yieldk(), and luaD_hook().

#define CIST_HOOKYIELD   (1<<7) /* last hook called yielded */

Definition at line 102 of file lstate.h.

Referenced by traceexec().

#define CIST_LUA   (1<<0) /* call is running a Lua function */

Definition at line 94 of file lstate.h.

Referenced by luaD_precall().

#define CIST_REENTRY
Value:
(1<<2) /* call is running on same invocation of
luaV_execute of previous call */

Definition at line 96 of file lstate.h.

Referenced by luaV_execute().

#define CIST_STAT   (1<<5) /* call has an error status (pcall) */

Definition at line 100 of file lstate.h.

Referenced by finishCcall(), and recover().

#define CIST_TAIL   (1<<6) /* call was tail called */

Definition at line 101 of file lstate.h.

Referenced by auxgetinfo(), callhook(), and luaV_execute().

#define CIST_YIELDED   (1<<3) /* call reentered after suspension */

Definition at line 98 of file lstate.h.

Referenced by finishCcall(), lua_getctx(), and resume().

#define CIST_YPCALL   (1<<4) /* call is a yieldable protected call */

Definition at line 99 of file lstate.h.

Referenced by findpcall(), finishCcall(), and lua_pcallk().

#define EXTRA_STACK   5
#define G (   L)    (L->l_G)
#define gch (   o)    (&(o)->gch)
#define gco2ccl (   o)    check_exp((o)->gch.tt == LUA_TCCL, &((o)->cl.c))

Definition at line 205 of file lstate.h.

Referenced by freeobj(), propagatemark(), and reallymarkobject().

#define gco2cl (   o)    check_exp(novariant((o)->gch.tt) == LUA_TFUNCTION, &((o)->cl))

Definition at line 206 of file lstate.h.

#define gco2lcl (   o)    check_exp((o)->gch.tt == LUA_TLCL, &((o)->cl.l))

Definition at line 204 of file lstate.h.

Referenced by freeobj(), propagatemark(), and reallymarkobject().

#define gco2p (   o)    check_exp((o)->gch.tt == LUA_TPROTO, &((o)->p))

Definition at line 209 of file lstate.h.

Referenced by freeobj(), propagatemark(), and reallymarkobject().

#define gco2t (   o)    check_exp((o)->gch.tt == LUA_TTABLE, &((o)->h))
#define gco2th (   o)    check_exp((o)->gch.tt == LUA_TTHREAD, &((o)->th))

Definition at line 211 of file lstate.h.

Referenced by freeobj(), propagatemark(), reallymarkobject(), and sweeplist().

#define gco2ts (   o)    (&rawgco2ts(o)->tsv)

Definition at line 201 of file lstate.h.

Referenced by freeobj(), luaS_resize(), and reallymarkobject().

#define gco2u (   o)    (&rawgco2u(o)->uv)

Definition at line 203 of file lstate.h.

Referenced by freeobj(), and reallymarkobject().

#define gco2uv (   o)    check_exp((o)->gch.tt == LUA_TUPVAL, &((o)->uv))

Definition at line 210 of file lstate.h.

Referenced by correctstack(), freeobj(), luaF_close(), luaF_findupval(), and reallymarkobject().

#define gettotalbytes (   g)    ((g)->totalbytes + (g)->GCdebt)
#define isLua (   ci)    ((ci)->callstatus & CIST_LUA)
#define KGC_EMERGENCY   1 /* gc was forced by an allocation failure */

Definition at line 54 of file lstate.h.

Referenced by checkSizes(), luaC_fullgc(), and sweepthread().

#define KGC_GEN   2 /* generational collection */

Definition at line 55 of file lstate.h.

Referenced by lua_gc(), luaC_changemode(), and luaC_fullgc().

#define KGC_NORMAL   0

Definition at line 53 of file lstate.h.

Referenced by lua_gc(), lua_newstate(), luaC_changemode(), luaC_freeallobjects(), and luaC_fullgc().

#define obj2gco (   v)    (cast(GCObject *, (v)))
#define rawgco2ts (   o)    check_exp(novariant((o)->gch.tt) == LUA_TSTRING, &((o)->ts))

Definition at line 199 of file lstate.h.

Referenced by internshrstr().

#define rawgco2u (   o)    check_exp((o)->gch.tt == LUA_TUSERDATA, &((o)->u))

Definition at line 202 of file lstate.h.

Typedef Documentation

typedef struct CallInfo CallInfo
typedef struct global_State global_State
typedef struct stringtable stringtable

Function Documentation

LUAI_FUNC CallInfo* luaE_extendCI ( lua_State L)

Definition at line 111 of file lstate.cpp.

References lua_State::ci, lua_assert, luaM_new, CallInfo::next, and CallInfo::previous.

LUAI_FUNC void luaE_freeCI ( lua_State L)

Definition at line 121 of file lstate.cpp.

References lua_State::ci, luaM_free, next, and CallInfo::next.

Referenced by freestack(), and sweepthread().

LUAI_FUNC void luaE_freethread ( lua_State L,
lua_State L1 
)
LUAI_FUNC void luaE_setdebt ( global_State g,
l_mem  debt 
)

Definition at line 105 of file lstate.cpp.

References global_State::GCdebt, and global_State::totalbytes.

Referenced by incstep(), lua_gc(), luaC_step(), and setpause().