diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2013-09-11 09:26:14 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2013-09-11 09:26:14 -0300 |
| commit | 115087344797d0aafb23f4fe5b902fdebd2c3310 (patch) | |
| tree | 732c83cee53b9d67b83cebfc2e5debd30d48eeed /lfunc.c | |
| parent | 79ab21be90792c00da98e5ec3d55c8a082c6e6de (diff) | |
| download | lua-115087344797d0aafb23f4fe5b902fdebd2c3310.tar.gz lua-115087344797d0aafb23f4fe5b902fdebd2c3310.tar.bz2 lua-115087344797d0aafb23f4fe5b902fdebd2c3310.zip | |
'luaC_newobj' does not handle special cases; only special case
now is threads, which do not use 'luaC_newobj' anymore.
Diffstat (limited to '')
| -rw-r--r-- | lfunc.c | 8 |
1 files changed, 4 insertions, 4 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lfunc.c,v 2.36 2013/08/27 18:53:35 roberto Exp roberto $ | 2 | ** $Id: lfunc.c,v 2.37 2013/08/27 20:04:00 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 | */ |
| @@ -21,14 +21,14 @@ | |||
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | Closure *luaF_newCclosure (lua_State *L, int n) { | 23 | Closure *luaF_newCclosure (lua_State *L, int n) { |
| 24 | Closure *c = &luaC_newobj(L, LUA_TCCL, sizeCclosure(n), NULL, 0)->cl; | 24 | Closure *c = &luaC_newobj(L, LUA_TCCL, sizeCclosure(n))->cl; |
| 25 | c->c.nupvalues = cast_byte(n); | 25 | c->c.nupvalues = cast_byte(n); |
| 26 | return c; | 26 | return c; |
| 27 | } | 27 | } |
| 28 | 28 | ||
| 29 | 29 | ||
| 30 | Closure *luaF_newLclosure (lua_State *L, int n) { | 30 | Closure *luaF_newLclosure (lua_State *L, int n) { |
| 31 | Closure *c = &luaC_newobj(L, LUA_TLCL, sizeLclosure(n), NULL, 0)->cl; | 31 | Closure *c = &luaC_newobj(L, LUA_TLCL, sizeLclosure(n))->cl; |
| 32 | c->l.p = NULL; | 32 | c->l.p = NULL; |
| 33 | c->l.nupvalues = cast_byte(n); | 33 | c->l.nupvalues = cast_byte(n); |
| 34 | while (n--) c->l.upvals[n] = NULL; | 34 | while (n--) c->l.upvals[n] = NULL; |
| @@ -85,7 +85,7 @@ void luaF_close (lua_State *L, StkId level) { | |||
| 85 | 85 | ||
| 86 | 86 | ||
| 87 | Proto *luaF_newproto (lua_State *L) { | 87 | Proto *luaF_newproto (lua_State *L) { |
| 88 | Proto *f = &luaC_newobj(L, LUA_TPROTO, sizeof(Proto), &G(L)->allgc, 0)->p; | 88 | Proto *f = &luaC_newobj(L, LUA_TPROTO, sizeof(Proto))->p; |
| 89 | nolocal(obj2gco(f)); /* prototypes are never local */ | 89 | nolocal(obj2gco(f)); /* prototypes are never local */ |
| 90 | f->k = NULL; | 90 | f->k = NULL; |
| 91 | f->sizek = 0; | 91 | f->sizek = 0; |
