no more special cases for closures with 0 upvalues (performance is the same,

memory use a little higher, code much simpler).
This commit is contained in:
Roberto Ierusalimschy
2000-03-29 17:19:20 -03:00
parent b53dc0c485
commit a69356e9e0
16 changed files with 128 additions and 194 deletions

View File

@@ -1,5 +1,5 @@
/*
** $Id: lfunc.c,v 1.19 2000/03/03 14:58:26 roberto Exp roberto $
** $Id: lfunc.c,v 1.20 2000/03/10 18:37:44 roberto Exp roberto $
** Auxiliary functions to manipulate prototypes and closures
** See Copyright Notice in lua.h
*/
@@ -19,7 +19,8 @@
Closure *luaF_newclosure (lua_State *L, int nelems) {
Closure *c = (Closure *)luaM_malloc(L, sizeof(Closure)+nelems*sizeof(TObject));
Closure *c = (Closure *)luaM_malloc(L, sizeof(Closure) +
sizeof(TObject)*(nelems-1));
c->next = L->rootcl;
L->rootcl = c;
c->marked = 0;