optimization: closures without upvalues don't need to be closures

This commit is contained in:
Roberto Ierusalimschy
1997-12-15 14:17:20 -02:00
parent 94144a7821
commit 45e533599f
13 changed files with 132 additions and 93 deletions

11
lfunc.c
View File

@@ -1,5 +1,5 @@
/*
** $Id: lfunc.c,v 1.6 1997/11/19 17:29:23 roberto Exp roberto $
** $Id: lfunc.c,v 1.7 1997/12/09 13:35:19 roberto Exp roberto $
** Auxiliar functions to manipulate prototypes and closures
** See Copyright Notice in lua.h
*/
@@ -26,15 +26,6 @@ Closure *luaF_newclosure (int nelems)
}
void luaF_simpleclosure (TObject *o)
{
Closure *c = luaF_newclosure(0);
c->consts[0] = *o;
ttype(o) = LUA_T_FUNCTION;
clvalue(o) = c;
}
TProtoFunc *luaF_newproto (void)
{
TProtoFunc *f = luaM_new(TProtoFunc);