lua5.4
| 宏定义 | 类型定义 | 函数
lstate.h 文件参考
#include "lua.h"
#include "lobject.h"
#include "ltm.h"
#include "lzio.h"
#include <signal.h>
lstate.h 的引用(Include)关系图:
此图展示该文件直接或间接的被哪些文件引用了:

浏览源代码.

struct  stringtable
 
struct  CallInfo
 
struct  global_State
 
struct  lua_State
 
union  GCUnion
 

宏定义

#define yieldable(L)   (((L)->nCcalls & 0xffff0000) == 0)
 
#define getCcalls(L)   ((L)->nCcalls & 0xffff)
 
#define incnny(L)   ((L)->nCcalls += 0x10000)
 
#define decnny(L)   ((L)->nCcalls -= 0x10000)
 
#define nyci   (0x10000 | 1)
 
#define l_signalT   sig_atomic_t
 
#define EXTRA_STACK   5
 
#define BASIC_STACK_SIZE   (2*LUA_MINSTACK)
 
#define stacksize(th)   cast_int((th)->stack_last - (th)->stack)
 
#define KGC_INC   0 /* incremental gc */
 
#define KGC_GEN   1 /* generational gc */
 
#define CIST_OAH   (1<<0) /* original value of 'allowhook' */
 
#define CIST_C   (1<<1) /* call is running a C function */
 
#define CIST_FRESH   (1<<2) /* call is on a fresh "luaV_execute" frame */
 
#define CIST_HOOKED   (1<<3) /* call is running a debug hook */
 
#define CIST_YPCALL   (1<<4) /* call is a yieldable protected call */
 
#define CIST_TAIL   (1<<5) /* call was tail called */
 
#define CIST_HOOKYIELD   (1<<6) /* last hook called yielded */
 
#define CIST_FIN   (1<<7) /* call is running a finalizer */
 
#define CIST_TRAN   (1<<8) /* 'ci' has transfer information */
 
#define isLua(ci)   (!((ci)->callstatus & CIST_C))
 
#define isLuacode(ci)   (!((ci)->callstatus & (CIST_C | CIST_HOOKED)))
 
#define setoah(st, v)   ((st) = ((st) & ~CIST_OAH) | (v))
 
#define getoah(st)   ((st) & CIST_OAH)
 
#define G(L)   (L->l_G)
 
#define cast_u(o)   cast(union GCUnion *, (o))
 
#define gco2ts(o)   check_exp(novariant((o)->tt) == LUA_TSTRING, &((cast_u(o))->ts))
 
#define gco2u(o)   check_exp((o)->tt == LUA_VUSERDATA, &((cast_u(o))->u))
 
#define gco2lcl(o)   check_exp((o)->tt == LUA_VLCL, &((cast_u(o))->cl.l))
 
#define gco2ccl(o)   check_exp((o)->tt == LUA_VCCL, &((cast_u(o))->cl.c))
 
#define gco2cl(o)   check_exp(novariant((o)->tt) == LUA_TFUNCTION, &((cast_u(o))->cl))
 
#define gco2t(o)   check_exp((o)->tt == LUA_VTABLE, &((cast_u(o))->h))
 
#define gco2p(o)   check_exp((o)->tt == LUA_VPROTO, &((cast_u(o))->p))
 
#define gco2th(o)   check_exp((o)->tt == LUA_VTHREAD, &((cast_u(o))->th))
 
#define gco2upv(o)   check_exp((o)->tt == LUA_VUPVAL, &((cast_u(o))->upv))
 
#define obj2gco(v)   check_exp((v)->tt >= LUA_TSTRING, &(cast_u(v)->gc))
 
#define gettotalbytes(g)   cast(lu_mem, (g)->totalbytes + (g)->GCdebt)
 

类型定义

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

函数

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)
 
LUAI_FUNC void luaE_shrinkCI (lua_State *L)
 
LUAI_FUNC void luaE_checkcstack (lua_State *L)
 
LUAI_FUNC void luaE_incCstack (lua_State *L)
 
LUAI_FUNC void luaE_warning (lua_State *L, const char *msg, int tocont)
 
LUAI_FUNC void luaE_warnerror (lua_State *L, const char *where)
 

宏定义说明

◆ BASIC_STACK_SIZE

#define BASIC_STACK_SIZE   (2*LUA_MINSTACK)

◆ cast_u

#define cast_u (   o)    cast(union GCUnion *, (o))

◆ CIST_C

#define CIST_C   (1<<1) /* call is running a C function */

◆ CIST_FIN

#define CIST_FIN   (1<<7) /* call is running a finalizer */

◆ CIST_FRESH

#define CIST_FRESH   (1<<2) /* call is on a fresh "luaV_execute" frame */

◆ CIST_HOOKED

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

◆ CIST_HOOKYIELD

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

◆ CIST_OAH

#define CIST_OAH   (1<<0) /* original value of 'allowhook' */

◆ CIST_TAIL

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

◆ CIST_TRAN

#define CIST_TRAN   (1<<8) /* 'ci' has transfer information */

◆ CIST_YPCALL

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

◆ decnny

#define decnny (   L)    ((L)->nCcalls -= 0x10000)

◆ EXTRA_STACK

#define EXTRA_STACK   5

◆ G

#define G (   L)    (L->l_G)

◆ gco2ccl

#define gco2ccl (   o)    check_exp((o)->tt == LUA_VCCL, &((cast_u(o))->cl.c))

◆ gco2cl

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

◆ gco2lcl

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

◆ gco2p

#define gco2p (   o)    check_exp((o)->tt == LUA_VPROTO, &((cast_u(o))->p))

◆ gco2t

#define gco2t (   o)    check_exp((o)->tt == LUA_VTABLE, &((cast_u(o))->h))

◆ gco2th

#define gco2th (   o)    check_exp((o)->tt == LUA_VTHREAD, &((cast_u(o))->th))

◆ gco2ts

#define gco2ts (   o)    check_exp(novariant((o)->tt) == LUA_TSTRING, &((cast_u(o))->ts))

◆ gco2u

#define gco2u (   o)    check_exp((o)->tt == LUA_VUSERDATA, &((cast_u(o))->u))

◆ gco2upv

#define gco2upv (   o)    check_exp((o)->tt == LUA_VUPVAL, &((cast_u(o))->upv))

◆ getCcalls

#define getCcalls (   L)    ((L)->nCcalls & 0xffff)

◆ getoah

#define getoah (   st)    ((st) & CIST_OAH)

◆ gettotalbytes

#define gettotalbytes (   g)    cast(lu_mem, (g)->totalbytes + (g)->GCdebt)

◆ incnny

#define incnny (   L)    ((L)->nCcalls += 0x10000)

◆ isLua

#define isLua (   ci)    (!((ci)->callstatus & CIST_C))

◆ isLuacode

#define isLuacode (   ci)    (!((ci)->callstatus & (CIST_C | CIST_HOOKED)))

◆ KGC_GEN

#define KGC_GEN   1 /* generational gc */

◆ KGC_INC

#define KGC_INC   0 /* incremental gc */

◆ l_signalT

#define l_signalT   sig_atomic_t

◆ nyci

#define nyci   (0x10000 | 1)

◆ obj2gco

#define obj2gco (   v)    check_exp((v)->tt >= LUA_TSTRING, &(cast_u(v)->gc))

◆ setoah

#define setoah (   st,
 
)    ((st) = ((st) & ~CIST_OAH) | (v))

◆ stacksize

#define stacksize (   th)    cast_int((th)->stack_last - (th)->stack)

◆ yieldable

#define yieldable (   L)    (((L)->nCcalls & 0xffff0000) == 0)

类型定义说明

◆ CallInfo

typedef struct CallInfo CallInfo

◆ global_State

typedef struct global_State global_State

◆ stringtable

typedef struct stringtable stringtable

函数说明

◆ luaE_checkcstack()

LUAI_FUNC void luaE_checkcstack ( lua_State L)
函数调用图:
这是这个函数的调用关系图:

◆ luaE_extendCI()

LUAI_FUNC CallInfo* luaE_extendCI ( lua_State L)

◆ luaE_freeCI()

LUAI_FUNC void luaE_freeCI ( lua_State L)
这是这个函数的调用关系图:

◆ luaE_freethread()

LUAI_FUNC void luaE_freethread ( lua_State L,
lua_State L1 
)
函数调用图:
这是这个函数的调用关系图:

◆ luaE_incCstack()

LUAI_FUNC void luaE_incCstack ( lua_State L)
函数调用图:
这是这个函数的调用关系图:

◆ luaE_setdebt()

LUAI_FUNC void luaE_setdebt ( global_State g,
l_mem  debt 
)
这是这个函数的调用关系图:

◆ luaE_shrinkCI()

LUAI_FUNC void luaE_shrinkCI ( lua_State L)
这是这个函数的调用关系图:

◆ luaE_warnerror()

LUAI_FUNC void luaE_warnerror ( lua_State L,
const char *  where 
)
函数调用图:
这是这个函数的调用关系图:

◆ luaE_warning()

LUAI_FUNC void luaE_warning ( lua_State L,
const char *  msg,
int  tocont 
)
这是这个函数的调用关系图: