diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-06-20 17:41:46 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-06-20 17:41:46 -0300 |
| commit | 3941af53adee868e2cccfb9b85783aba9ac311c1 (patch) | |
| tree | 8b6295c8aefacf286c13c7d78b1d2a91421ce2b1 /lfunc.c | |
| parent | 5610fdd776edd0de71864f79d50b4526df861d75 (diff) | |
| download | lua-3941af53adee868e2cccfb9b85783aba9ac311c1.tar.gz lua-3941af53adee868e2cccfb9b85783aba9ac311c1.tar.bz2 lua-3941af53adee868e2cccfb9b85783aba9ac311c1.zip | |
first implementation of independent global table per function
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.55 2002/03/25 17:47:14 roberto Exp roberto $ | 2 | ** $Id: lfunc.c,v 1.56 2002/05/02 13:06:20 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 | */ |
| @@ -34,12 +34,13 @@ Closure *luaF_newCclosure (lua_State *L, int nelems) { | |||
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | 36 | ||
| 37 | Closure *luaF_newLclosure (lua_State *L, int nelems) { | 37 | Closure *luaF_newLclosure (lua_State *L, int nelems, TObject *gt) { |
| 38 | Closure *c = cast(Closure *, luaM_malloc(L, sizeLclosure(nelems))); | 38 | Closure *c = cast(Closure *, luaM_malloc(L, sizeLclosure(nelems))); |
| 39 | c->l.isC = 0; | 39 | c->l.isC = 0; |
| 40 | c->c.next = G(L)->rootcl; | 40 | c->c.next = G(L)->rootcl; |
| 41 | G(L)->rootcl = c; | 41 | G(L)->rootcl = c; |
| 42 | c->l.marked = 0; | 42 | c->l.marked = 0; |
| 43 | c->l.g = *gt; | ||
| 43 | c->l.nupvalues = cast(lu_byte, nelems); | 44 | c->l.nupvalues = cast(lu_byte, nelems); |
| 44 | return c; | 45 | return c; |
| 45 | } | 46 | } |
