lua/lstate.c File Reference

#include <stdlib.h>
#include "lua.h"
#include "ldebug.h"
#include "ldo.h"
#include "lfunc.h"
#include "lgc.h"
#include "llex.h"
#include "lmem.h"
#include "lstate.h"
#include "lstring.h"
#include "ltable.h"
#include "ltm.h"

Go to the source code of this file.

Defines

#define lstate_c
#define EXTRASPACE   0

Functions

static int default_panic (lua_State *L)
static lua_Statemallocstate (lua_State *L)
static void freestate (lua_State *L, lua_State *L1)
static void stack_init (lua_State *L1, lua_State *L)
static void freestack (lua_State *L, lua_State *L1)
static void f_luaopen (lua_State *L, void *ud)
static void preinit_state (lua_State *L)
static void close_state (lua_State *L)
lua_StateluaE_newthread (lua_State *L)
void luaE_freethread (lua_State *L, lua_State *L1)
LUA_API lua_Statelua_open (void)
static void callallgcTM (lua_State *L, void *ud)
LUA_API void lua_close (lua_State *L)


Define Documentation

#define EXTRASPACE   0

Definition at line 30 of file lstate.c.

Referenced by freestate(), and mallocstate().

#define lstate_c

Definition at line 10 of file lstate.c.


Function Documentation

static void callallgcTM ( lua_State L,
void *  ud 
) [static]

Definition at line 218 of file lstate.c.

References luaC_callGCTM(), and UNUSED.

Referenced by lua_close().

static void close_state ( lua_State L  )  [static]

Definition at line 159 of file lstate.c.

References freestack(), freestate(), G, lua_assert, luaC_sweep(), luaF_close(), luaM_freelem, luaS_freeall(), luaZ_freebuffer, and lua_State::stack.

Referenced by lua_close(), and lua_open().

static int default_panic ( lua_State L  )  [static]

Definition at line 42 of file lstate.c.

References UNUSED.

Referenced by f_luaopen().

static void f_luaopen ( lua_State L,
void *  ud 
) [static]

Definition at line 100 of file lstate.c.

References global_State::buff, default_panic(), defaultmeta, global_State::dummynode, G, global_State::GCthreshold, gkey, gt, gval, stringtable::hash, hvalue, luaD_throw(), luaH_new(), luaM_new, luaS_fix, luaS_newliteral, luaS_resize(), luaT_init(), luaX_init(), luaZ_initbuffer, global_State::mainthread, MEMERRMSG, MINSTRTABSIZE, global_State::nblocks, Node::next, stringtable::nuse, global_State::panic, registry, global_State::rootgc, global_State::rootudata, sethvalue, setnilvalue, stringtable::size, stack_init(), global_State::strt, global_State::tmudata, and UNUSED.

Referenced by lua_open().

static void freestack ( lua_State L,
lua_State L1 
) [static]

Definition at line 89 of file lstate.c.

References lua_State::base_ci, luaM_freearray, lua_State::size_ci, lua_State::stack, and lua_State::stacksize.

Referenced by close_state(), and luaE_freethread().

static void freestate ( lua_State L,
lua_State L1 
) [static]

Definition at line 63 of file lstate.c.

References cast, EXTRASPACE, and luaM_free.

Referenced by close_state(), and luaE_freethread().

LUA_API void lua_close ( lua_State L  ) 

Definition at line 226 of file lstate.c.

References CallInfo::base, lua_State::base, lua_State::base_ci, callallgcTM(), lua_State::ci, close_state(), lua_State::errfunc, G, lua_assert, lua_lock, luaC_separateudata(), luaD_rawrunprotected(), luaF_close(), lua_State::nCcalls, lua_State::stack, and lua_State::top.

LUA_API lua_State* lua_open ( void   ) 

Definition at line 199 of file lstate.c.

References close_state(), f_luaopen(), lua_State::gclist, lua_State::l_G, lua_userstateopen, luaD_rawrunprotected(), mallocstate(), lua_State::marked, lua_State::next, preinit_state(), and lua_State::tt.

void luaE_freethread ( lua_State L,
lua_State L1 
)

Definition at line 190 of file lstate.c.

References freestack(), freestate(), lua_assert, luaF_close(), lua_State::openupval, and lua_State::stack.

Referenced by freeobj().

lua_State* luaE_newthread ( lua_State L  ) 

Definition at line 179 of file lstate.c.

References gt, lua_State::l_G, luaC_link(), mallocstate(), preinit_state(), setobj2n, stack_init(), and valtogco.

Referenced by lua_newthread().

static lua_State* mallocstate ( lua_State L  )  [static]

Definition at line 51 of file lstate.c.

References block(), cast, EXTRASPACE, and luaM_malloc.

Referenced by lua_open(), and luaE_newthread().

static void preinit_state ( lua_State L  )  [static]

Definition at line 139 of file lstate.c.

References lua_State::allowhook, lua_State::base_ci, lua_State::basehookcount, lua_State::ci, lua_State::errfunc, lua_State::errorJmp, gt, lua_State::hook, lua_State::hookinit, lua_State::hookmask, lua_State::nCcalls, lua_State::openupval, resethookcount, setnilvalue, lua_State::size_ci, lua_State::stack, and lua_State::stacksize.

Referenced by lua_open(), and luaE_newthread().

static void stack_init ( lua_State L1,
lua_State L 
) [static]

Definition at line 71 of file lstate.c.

References CallInfo::base, lua_State::base, lua_State::base_ci, BASIC_CI_SIZE, BASIC_STACK_SIZE, lua_State::ci, CI_C, lua_State::end_ci, EXTRA_STACK, luaM_newvector, setnilvalue, lua_State::size_ci, lua_State::stack, lua_State::stack_last, lua_State::stacksize, CallInfo::state, CallInfo::top, and lua_State::top.

Referenced by f_luaopen(), and luaE_newthread().


Generated on Fri Oct 12 08:44:56 2007 for rpm by  doxygen 1.5.2