aboutsummaryrefslogtreecommitdiff
path: root/lfunc.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1997-12-15 14:17:20 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1997-12-15 14:17:20 -0200
commit45e533599f08d849951b49bcab0be4fd735a966d (patch)
treeb8e3b175989f694391dd3da4191894f5df1e7d75 /lfunc.c
parent94144a7821c0fa412d5d228ab5197a8ebaaa3c25 (diff)
downloadlua-45e533599f08d849951b49bcab0be4fd735a966d.tar.gz
lua-45e533599f08d849951b49bcab0be4fd735a966d.tar.bz2
lua-45e533599f08d849951b49bcab0be4fd735a966d.zip
optimization: closures without upvalues don't need to be closures
Diffstat (limited to 'lfunc.c')
-rw-r--r--lfunc.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/lfunc.c b/lfunc.c
index 82f3407b..2f3035aa 100644
--- a/lfunc.c
+++ b/lfunc.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lfunc.c,v 1.6 1997/11/19 17:29:23 roberto Exp roberto $ 2** $Id: lfunc.c,v 1.7 1997/12/09 13:35:19 roberto Exp roberto $
3** Auxiliar functions to manipulate prototypes and closures 3** Auxiliar functions to manipulate prototypes and closures
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -26,15 +26,6 @@ Closure *luaF_newclosure (int nelems)
26} 26}
27 27
28 28
29void luaF_simpleclosure (TObject *o)
30{
31 Closure *c = luaF_newclosure(0);
32 c->consts[0] = *o;
33 ttype(o) = LUA_T_FUNCTION;
34 clvalue(o) = c;
35}
36
37
38TProtoFunc *luaF_newproto (void) 29TProtoFunc *luaF_newproto (void)
39{ 30{
40 TProtoFunc *f = luaM_new(TProtoFunc); 31 TProtoFunc *f = luaM_new(TProtoFunc);