diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-12-15 14:17:20 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-12-15 14:17:20 -0200 |
commit | 45e533599f08d849951b49bcab0be4fd735a966d (patch) | |
tree | b8e3b175989f694391dd3da4191894f5df1e7d75 /lfunc.c | |
parent | 94144a7821c0fa412d5d228ab5197a8ebaaa3c25 (diff) | |
download | lua-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.c | 11 |
1 files changed, 1 insertions, 10 deletions
@@ -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 | ||
29 | void 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 | |||
38 | TProtoFunc *luaF_newproto (void) | 29 | TProtoFunc *luaF_newproto (void) |
39 | { | 30 | { |
40 | TProtoFunc *f = luaM_new(TProtoFunc); | 31 | TProtoFunc *f = luaM_new(TProtoFunc); |