Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
lstate.h File Reference
#include "lua.h"
#include "lobject.h"
#include "ltm.h"
#include "lzio.h"

Go to the source code of this file.

Data Structures

struct  stringtable
 
struct  CallInfo
 
struct  global_State
 
struct  lua_State
 
struct  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

◆ BASIC_STACK_SIZE

#define BASIC_STACK_SIZE   (2*LUA_MINSTACK)

Definition at line 50 of file lua-5.2.4/src/lstate.h.

◆ CIST_HOOKED

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

◆ CIST_HOOKYIELD

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

Definition at line 102 of file lua-5.2.4/src/lstate.h.

Referenced by luaG_traceexec(), luaG_traceexec(), and traceexec().

◆ CIST_LUA

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

Definition at line 95 of file lua-5.2.4/src/lstate.h.

Referenced by luaD_precall().

◆ CIST_REENTRY

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

Definition at line 97 of file lua-5.2.4/src/lstate.h.

Referenced by luaV_execute().

◆ CIST_STAT

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

Definition at line 100 of file lua-5.2.4/src/lstate.h.

Referenced by finishCcall(), and recover().

◆ CIST_TAIL

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

◆ CIST_YIELDED

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

Definition at line 98 of file lua-5.2.4/src/lstate.h.

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

◆ CIST_YPCALL

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

◆ EXTRA_STACK

#define EXTRA_STACK   5

Definition at line 47 of file lua-5.2.4/src/lstate.h.

◆ G

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

Definition at line 178 of file lua-5.2.4/src/lstate.h.

◆ gch

◆ gco2ccl

◆ gco2cl

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

Definition at line 206 of file lua-5.2.4/src/lstate.h.

206#define gco2ccl(o) check_exp((o)->gch.tt == LUA_TCCL, &((o)->cl.c))
207#define gco2cl(o) \

◆ gco2lcl

◆ gco2p

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

Definition at line 209 of file lua-5.2.4/src/lstate.h.

◆ gco2t

◆ gco2th

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

Definition at line 211 of file lua-5.2.4/src/lstate.h.

◆ gco2ts

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

Definition at line 201 of file lua-5.2.4/src/lstate.h.

◆ gco2u

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

Definition at line 203 of file lua-5.2.4/src/lstate.h.

◆ gco2uv

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

Definition at line 210 of file lua-5.2.4/src/lstate.h.

◆ gettotalbytes

◆ isLua

#define isLua ( ci)    ((ci)->callstatus & CIST_LUA)

Definition at line 105 of file lua-5.2.4/src/lstate.h.

◆ KGC_EMERGENCY

#define KGC_EMERGENCY   1 /* gc was forced by an allocation failure */

◆ KGC_GEN

#define KGC_GEN   2 /* generational collection */

◆ KGC_NORMAL

#define KGC_NORMAL   0

◆ obj2gco

#define obj2gco ( v)    (cast(GCObject *, (v)))

Definition at line 214 of file lua-5.2.4/src/lstate.h.

◆ rawgco2ts

#define rawgco2ts ( o)     check_exp(novariant((o)->gch.tt) == LUA_TSTRING, &((o)->ts))

Definition at line 199 of file lua-5.2.4/src/lstate.h.

199/* macros to convert a GCObject into a specific value */
200#define rawgco2ts(o) \

◆ rawgco2u

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

Definition at line 202 of file lua-5.2.4/src/lstate.h.

Typedef Documentation

◆ CallInfo

typedef struct CallInfo CallInfo

◆ global_State

typedef struct global_State global_State

◆ stringtable

typedef struct stringtable stringtable

Function Documentation

◆ luaE_extendCI()

LUAI_FUNC CallInfo * luaE_extendCI ( lua_State * L)

Definition at line 112 of file lua-5.2.4/src/lstate.c.

112 {
113 CallInfo *ci = luaM_new(L, CallInfo);
114 lua_assert(L->ci->next == NULL);
115 L->ci->next = ci;
116 ci->previous = L->ci;
117 ci->next = NULL;
118 return ci;
119}
#define NULL
Definition gmacros.h:924
#define lua_assert(c)
#define luaM_new(L, t)
struct CallInfo * previous
struct CallInfo * next

◆ luaE_freeCI()

LUAI_FUNC void luaE_freeCI ( lua_State * L)

Definition at line 122 of file lua-5.2.4/src/lstate.c.

122 {
123 CallInfo *ci = L->ci;
124 CallInfo *next = ci->next;
125 ci->next = NULL;
126 while ((ci = next) != NULL) {
127 next = ci->next;
128 luaM_free(L, ci);
129 }
130}
#define next(ls)
#define luaM_free(L, b)

◆ luaE_freethread()

LUAI_FUNC void luaE_freethread ( lua_State * L,
lua_State * L1 )

Definition at line 134 of file lua-5.1.5/src/lstate.c.

134 {
135 luaF_close(L1, L1->stack); /* close all upvalues for this thread */
136 lua_assert(L1->openupval == NULL);
138 freestack(L, L1);
140}
void luaF_close(lua_State *L, StkId level)
#define luaM_freemem(L, b, s)
#define state_size(x)
static void freestack(lua_State *L, lua_State *L1)
#define fromstate(l)
#define luai_userstatefree(L)
GCObject * openupval

◆ luaE_setdebt()

LUAI_FUNC void luaE_setdebt ( global_State * g,
l_mem debt )

Definition at line 106 of file lua-5.2.4/src/lstate.c.

106 {
107 g->totalbytes -= (debt - g->GCdebt);
108 g->GCdebt = debt;
109}