From 5ee63257f9eee2216b6ed06afa93aceac3227fb4 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 24 Nov 2003 16:50:36 -0200 Subject: [PATCH] macros for closure sizes are global --- lfunc.c | 9 +-------- lfunc.h | 9 ++++++++- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lfunc.c b/lfunc.c index 07484700..a2a28457 100644 --- a/lfunc.c +++ b/lfunc.c @@ -1,5 +1,5 @@ /* -** $Id: lfunc.c,v 1.70 2003/11/17 19:50:05 roberto Exp roberto $ +** $Id: lfunc.c,v 1.71 2003/11/19 19:41:30 roberto Exp roberto $ ** Auxiliary functions to manipulate prototypes and closures ** See Copyright Notice in lua.h */ @@ -18,13 +18,6 @@ #include "lstate.h" -#define sizeCclosure(n) (cast(int, sizeof(CClosure)) + \ - cast(int, sizeof(TObject)*((n)-1))) - -#define sizeLclosure(n) (cast(int, sizeof(LClosure)) + \ - cast(int, sizeof(TObject *)*((n)-1))) - - Closure *luaF_newCclosure (lua_State *L, int nelems) { Closure *c = cast(Closure *, luaM_malloc(L, sizeCclosure(nelems))); diff --git a/lfunc.h b/lfunc.h index ae55e289..bb0fa001 100644 --- a/lfunc.h +++ b/lfunc.h @@ -1,5 +1,5 @@ /* -** $Id: lfunc.h,v 1.21 2003/03/18 12:50:04 roberto Exp roberto $ +** $Id: lfunc.h,v 1.22 2003/10/20 17:42:41 roberto Exp roberto $ ** Auxiliary functions to manipulate prototypes and closures ** See Copyright Notice in lua.h */ @@ -11,6 +11,13 @@ #include "lobject.h" +#define sizeCclosure(n) (cast(int, sizeof(CClosure)) + \ + cast(int, sizeof(TObject)*((n)-1))) + +#define sizeLclosure(n) (cast(int, sizeof(LClosure)) + \ + cast(int, sizeof(TObject *)*((n)-1))) + + Proto *luaF_newproto (lua_State *L); Closure *luaF_newCclosure (lua_State *L, int nelems); Closure *luaF_newLclosure (lua_State *L, int nelems, TObject *e);