Skip to content

Commit

Permalink
macros for closure sizes are global
Browse files Browse the repository at this point in the history
  • Loading branch information
roberto-ieru committed Nov 24, 2003
1 parent 8bc6c68 commit 5ee6325
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
9 changes: 1 addition & 8 deletions lfunc.c
Original file line number Diff line number Diff line change
@@ -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
*/
Expand All @@ -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)));
Expand Down
9 changes: 8 additions & 1 deletion lfunc.h
Original file line number Diff line number Diff line change
@@ -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
*/
Expand All @@ -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);
Expand Down

0 comments on commit 5ee6325

Please sign in to comment.