diff options
Diffstat (limited to 'lstring.h')
-rw-r--r-- | lstring.h | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstring.h,v 1.24 2000/10/30 17:49:19 roberto Exp roberto $ | 2 | ** $Id: lstring.h,v 1.25 2000/11/24 17:39:56 roberto Exp roberto $ |
3 | ** String table (keep all strings handled by Lua) | 3 | ** String table (keep all strings handled by Lua) |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -12,6 +12,17 @@ | |||
12 | #include "lstate.h" | 12 | #include "lstate.h" |
13 | 13 | ||
14 | 14 | ||
15 | |||
16 | /* | ||
17 | ** type equivalent to TString, but with maximum alignment requirements | ||
18 | */ | ||
19 | union L_UTString { | ||
20 | TString ts; | ||
21 | union L_Umaxalign dummy; /* ensures maximum alignment for `local' udata */ | ||
22 | }; | ||
23 | |||
24 | |||
25 | |||
15 | /* | 26 | /* |
16 | ** any TString with mark>=FIXMARK is never collected. | 27 | ** any TString with mark>=FIXMARK is never collected. |
17 | ** Marks>=RESERVEDMARK are used to identify reserved words. | 28 | ** Marks>=RESERVEDMARK are used to identify reserved words. |
@@ -23,6 +34,8 @@ | |||
23 | #define sizestring(l) ((lint32)sizeof(TString) + \ | 34 | #define sizestring(l) ((lint32)sizeof(TString) + \ |
24 | ((lint32)(l+1)-TSPACK)*(lint32)sizeof(char)) | 35 | ((lint32)(l+1)-TSPACK)*(lint32)sizeof(char)) |
25 | 36 | ||
37 | #define sizeudata(l) ((luint32)sizeof(union L_UTString)+(l)) | ||
38 | |||
26 | 39 | ||
27 | void luaS_init (lua_State *L); | 40 | void luaS_init (lua_State *L); |
28 | void luaS_resize (lua_State *L, stringtable *tb, int newsize); | 41 | void luaS_resize (lua_State *L, stringtable *tb, int newsize); |