aboutsummaryrefslogtreecommitdiff
path: root/lstate.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-05-08 14:34:23 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-05-08 14:34:23 -0300
commit01f1ac36b13f4fb23527785add70afe64f275944 (patch)
tree7baf8b33faacb220683f416528e3fcc0cd033735 /lstate.h
parenta4d06736d4a66e1653599fad3df39099bf5b1276 (diff)
downloadlua-01f1ac36b13f4fb23527785add70afe64f275944.tar.gz
lua-01f1ac36b13f4fb23527785add70afe64f275944.tar.bz2
lua-01f1ac36b13f4fb23527785add70afe64f275944.zip
`global' tables (registry, etc.) stored in proper place, not in the stack
Diffstat (limited to 'lstate.h')
-rw-r--r--lstate.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/lstate.h b/lstate.h
index 84971213..edafe539 100644
--- a/lstate.h
+++ b/lstate.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstate.h,v 1.83 2002/04/16 17:08:28 roberto Exp roberto $ 2** $Id: lstate.h,v 1.84 2002/04/23 15:04:39 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*/
@@ -50,23 +50,23 @@ struct lua_longjmp; /* defined in ldo.c */
50 50
51 51
52/* 52/*
53** reserve init of stack to store some global values 53** array of `global' objects
54*/ 54*/
55 55
56#define NUMGLOBS 3
57
56/* default meta table (both for tables and udata) */ 58/* default meta table (both for tables and udata) */
57#define defaultmeta(L) (L->stack) 59#define defaultmeta(L) (L->globs)
58 60
59/* table of globals */ 61/* table of globals */
60#define gt(L) (L->stack + 1) 62#define gt(L) (L->globs + 1)
61 63
62/* registry */ 64/* registry */
63#define registry(L) (L->stack + 2) 65#define registry(L) (L->globs + 2)
64
65#define RESERVED_STACK_PREFIX 3
66 66
67 67
68/* space to handle TM calls */ 68/* space to handle TM calls and other temporary overflows */
69#define EXTRA_STACK 4 69#define EXTRA_STACK 5
70 70
71 71
72#define BASIC_CI_SIZE 8 72#define BASIC_CI_SIZE 8
@@ -130,6 +130,7 @@ struct lua_State {
130 CallInfo *end_ci; /* points after end of ci array*/ 130 CallInfo *end_ci; /* points after end of ci array*/
131 CallInfo *base_ci; /* array of CallInfo's */ 131 CallInfo *base_ci; /* array of CallInfo's */
132 global_State *l_G; 132 global_State *l_G;
133 TObject globs[NUMGLOBS]; /* registry, table of globals, etc. */
133 struct lua_longjmp *errorJmp; /* current error recover point */ 134 struct lua_longjmp *errorJmp; /* current error recover point */
134 UpVal *openupval; /* list of open upvalues in this stack */ 135 UpVal *openupval; /* list of open upvalues in this stack */
135 lua_State *next; /* circular double linked list of states */ 136 lua_State *next; /* circular double linked list of states */