diff options
Diffstat (limited to 'lstate.c')
-rw-r--r-- | lstate.c | 19 |
1 files changed, 4 insertions, 15 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstate.c,v 2.24 2005/02/10 13:25:02 roberto Exp roberto $ | 2 | ** $Id: lstate.c,v 2.25 2005/02/23 17:30:22 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 | */ |
@@ -24,20 +24,9 @@ | |||
24 | #include "ltm.h" | 24 | #include "ltm.h" |
25 | 25 | ||
26 | 26 | ||
27 | /* | 27 | #define state_size(x) (sizeof(x) + LUAI_EXTRASPACE) |
28 | ** macro to allow the inclusion of user information in Lua state | 28 | #define fromstate(l) (cast(lu_byte *, (l)) - LUAI_EXTRASPACE) |
29 | */ | 29 | #define tostate(l) (cast(lua_State *, cast(lu_byte *, l) + LUAI_EXTRASPACE)) |
30 | #ifndef LUA_USERSTATE | ||
31 | #define EXTRASPACE 0 | ||
32 | #else | ||
33 | union UEXTRASPACE {L_Umaxalign a; LUA_USERSTATE b;}; | ||
34 | #define EXTRASPACE (sizeof(union UEXTRASPACE)) | ||
35 | #endif | ||
36 | |||
37 | |||
38 | #define state_size(x) (sizeof(x) + EXTRASPACE) | ||
39 | #define tostate(l) (cast(lua_State *, cast(lu_byte *, l) + EXTRASPACE)) | ||
40 | #define fromstate(l) (cast(lu_byte *, (l)) - EXTRASPACE) | ||
41 | 30 | ||
42 | 31 | ||
43 | /* | 32 | /* |