diff options
| -rw-r--r-- | lfunc.c | 9 | ||||
| -rw-r--r-- | lfunc.h | 9 |
2 files changed, 9 insertions, 9 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lfunc.c,v 1.70 2003/11/17 19:50:05 roberto Exp roberto $ | 2 | ** $Id: lfunc.c,v 1.71 2003/11/19 19:41:30 roberto Exp roberto $ |
| 3 | ** Auxiliary functions to manipulate prototypes and closures | 3 | ** Auxiliary functions to manipulate prototypes and closures |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -18,13 +18,6 @@ | |||
| 18 | #include "lstate.h" | 18 | #include "lstate.h" |
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | #define sizeCclosure(n) (cast(int, sizeof(CClosure)) + \ | ||
| 22 | cast(int, sizeof(TObject)*((n)-1))) | ||
| 23 | |||
| 24 | #define sizeLclosure(n) (cast(int, sizeof(LClosure)) + \ | ||
| 25 | cast(int, sizeof(TObject *)*((n)-1))) | ||
| 26 | |||
| 27 | |||
| 28 | 21 | ||
| 29 | Closure *luaF_newCclosure (lua_State *L, int nelems) { | 22 | Closure *luaF_newCclosure (lua_State *L, int nelems) { |
| 30 | Closure *c = cast(Closure *, luaM_malloc(L, sizeCclosure(nelems))); | 23 | Closure *c = cast(Closure *, luaM_malloc(L, sizeCclosure(nelems))); |
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lfunc.h,v 1.21 2003/03/18 12:50:04 roberto Exp roberto $ | 2 | ** $Id: lfunc.h,v 1.22 2003/10/20 17:42:41 roberto Exp roberto $ |
| 3 | ** Auxiliary functions to manipulate prototypes and closures | 3 | ** Auxiliary functions to manipulate prototypes and closures |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -11,6 +11,13 @@ | |||
| 11 | #include "lobject.h" | 11 | #include "lobject.h" |
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | #define sizeCclosure(n) (cast(int, sizeof(CClosure)) + \ | ||
| 15 | cast(int, sizeof(TObject)*((n)-1))) | ||
| 16 | |||
| 17 | #define sizeLclosure(n) (cast(int, sizeof(LClosure)) + \ | ||
| 18 | cast(int, sizeof(TObject *)*((n)-1))) | ||
| 19 | |||
| 20 | |||
| 14 | Proto *luaF_newproto (lua_State *L); | 21 | Proto *luaF_newproto (lua_State *L); |
| 15 | Closure *luaF_newCclosure (lua_State *L, int nelems); | 22 | Closure *luaF_newCclosure (lua_State *L, int nelems); |
| 16 | Closure *luaF_newLclosure (lua_State *L, int nelems, TObject *e); | 23 | Closure *luaF_newLclosure (lua_State *L, int nelems, TObject *e); |
