diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-03-29 17:19:20 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-03-29 17:19:20 -0300 |
commit | a69356e9e0a7525b1cebadc928a0efcce8c39b46 (patch) | |
tree | c676ee2997c699d3e0b036323ecbafa7ea0d786f /lfunc.c | |
parent | b53dc0c4853c56694dda727793e5f6188de39dd8 (diff) | |
download | lua-a69356e9e0a7525b1cebadc928a0efcce8c39b46.tar.gz lua-a69356e9e0a7525b1cebadc928a0efcce8c39b46.tar.bz2 lua-a69356e9e0a7525b1cebadc928a0efcce8c39b46.zip |
no more special cases for closures with 0 upvalues (performance is the same,
memory use a little higher, code much simpler).
Diffstat (limited to 'lfunc.c')
-rw-r--r-- | lfunc.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lfunc.c,v 1.19 2000/03/03 14:58:26 roberto Exp roberto $ | 2 | ** $Id: lfunc.c,v 1.20 2000/03/10 18:37:44 roberto Exp roberto $ |
3 | ** Auxiliary functions to manipulate prototypes and closures | 3 | ** Auxiliary functions to manipulate prototypes and closures |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -19,7 +19,8 @@ | |||
19 | 19 | ||
20 | 20 | ||
21 | Closure *luaF_newclosure (lua_State *L, int nelems) { | 21 | Closure *luaF_newclosure (lua_State *L, int nelems) { |
22 | Closure *c = (Closure *)luaM_malloc(L, sizeof(Closure)+nelems*sizeof(TObject)); | 22 | Closure *c = (Closure *)luaM_malloc(L, sizeof(Closure) + |
23 | sizeof(TObject)*(nelems-1)); | ||
23 | c->next = L->rootcl; | 24 | c->next = L->rootcl; |
24 | L->rootcl = c; | 25 | L->rootcl = c; |
25 | c->marked = 0; | 26 | c->marked = 0; |