Lines Matching refs:L1
42 static void stack_init (lua_State *L1, lua_State *L) { in stack_init() argument
44 L1->base_ci = luaM_newvector(L, BASIC_CI_SIZE, CallInfo); in stack_init()
45 L1->ci = L1->base_ci; in stack_init()
46 L1->size_ci = BASIC_CI_SIZE; in stack_init()
47 L1->end_ci = L1->base_ci + L1->size_ci - 1; in stack_init()
49 L1->stack = luaM_newvector(L, BASIC_STACK_SIZE + EXTRA_STACK, TValue); in stack_init()
50 L1->stacksize = BASIC_STACK_SIZE + EXTRA_STACK; in stack_init()
51 L1->top = L1->stack; in stack_init()
52 L1->stack_last = L1->stack+(L1->stacksize - EXTRA_STACK)-1; in stack_init()
54 L1->ci->func = L1->top; in stack_init()
55 setnilvalue(L1->top++); /* `function' entry for this `ci' */ in stack_init()
56 L1->base = L1->ci->base = L1->top; in stack_init()
57 L1->ci->top = L1->top + LUA_MINSTACK; in stack_init()
61 static void freestack (lua_State *L, lua_State *L1) { in freestack() argument
62 luaM_freearray(L, L1->base_ci, L1->size_ci, CallInfo); in freestack()
63 luaM_freearray(L, L1->stack, L1->stacksize, TValue); in freestack()
120 lua_State *L1 = tostate(luaM_malloc(L, state_size(lua_State))); in luaE_newthread() local
121 luaC_link(L, obj2gco(L1), LUA_TTHREAD); in luaE_newthread()
122 preinit_state(L1, G(L)); in luaE_newthread()
123 stack_init(L1, L); /* init stack */ in luaE_newthread()
124 setobj2n(L, gt(L1), gt(L)); /* share table of globals */ in luaE_newthread()
125 L1->hookmask = L->hookmask; in luaE_newthread()
126 L1->basehookcount = L->basehookcount; in luaE_newthread()
127 L1->hook = L->hook; in luaE_newthread()
128 resethookcount(L1); in luaE_newthread()
129 lua_assert(iswhite(obj2gco(L1))); in luaE_newthread()
130 return L1; in luaE_newthread()
134 void luaE_freethread (lua_State *L, lua_State *L1) { in luaE_freethread() argument
135 luaF_close(L1, L1->stack); /* close all upvalues for this thread */ in luaE_freethread()
136 lua_assert(L1->openupval == NULL); in luaE_freethread()
137 luai_userstatefree(L1); in luaE_freethread()
138 freestack(L, L1); in luaE_freethread()
139 luaM_freemem(L, fromstate(L1), state_size(lua_State)); in luaE_freethread()