aboutsummaryrefslogtreecommitdiff
path: root/lstate.h
diff options
context:
space:
mode:
Diffstat (limited to 'lstate.h')
-rw-r--r--lstate.h27
1 files changed, 14 insertions, 13 deletions
diff --git a/lstate.h b/lstate.h
index 2ee31840..1b946312 100644
--- a/lstate.h
+++ b/lstate.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstate.h,v 1.22 1999/11/10 15:39:35 roberto Exp roberto $ 2** $Id: lstate.h,v 1.23 1999/11/22 13:12:07 roberto Exp roberto $
3** Global State 3** Global State
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -15,7 +15,7 @@
15 15
16 16
17 17
18typedef int StkId; /* index to stack elements */ 18typedef TObject *StkId; /* index to stack elements */
19 19
20 20
21/* 21/*
@@ -27,17 +27,16 @@ struct lua_longjmp {
27}; 27};
28 28
29 29
30struct Stack { 30/*
31 TObject *top; 31** stack layout for C point of view:
32 TObject *stack; 32** [lua2C, lua2C+num) - `array' lua2C
33 TObject *last; 33** [lua2C+num, base) - space for extra lua_Objects
34}; 34** [base, L->top) - `stack' C2Lua
35 35*/
36struct C_Lua_Stack { 36struct C_Lua_Stack {
37 StkId base; /* when Lua calls C or C calls Lua, points to */ 37 StkId base;
38 /* the first slot after the last parameter. */ 38 StkId lua2C;
39 StkId lua2C; /* points to first element of "array" lua2C */ 39 int num;
40 int num; /* size of "array" lua2C */
41}; 40};
42 41
43 42
@@ -51,7 +50,9 @@ typedef struct stringtable {
51 50
52struct lua_State { 51struct lua_State {
53 /* thread-specific state */ 52 /* thread-specific state */
54 struct Stack stack; /* Lua stack */ 53 StkId top; /* first free slot in the stack */
54 StkId stack; /* stack base */
55 StkId stack_last; /* last free slot in the stack */
55 struct C_Lua_Stack Cstack; /* C2lua struct */ 56 struct C_Lua_Stack Cstack; /* C2lua struct */
56 struct lua_longjmp *errorJmp; /* current error recover point */ 57 struct lua_longjmp *errorJmp; /* current error recover point */
57 char *Mbuffer; /* global buffer */ 58 char *Mbuffer; /* global buffer */