'luaC_newobj' does not handle special cases; only special case

now is threads, which do not use 'luaC_newobj' anymore.
This commit is contained in:
Roberto Ierusalimschy
2013-09-11 09:26:14 -03:00
parent 79ab21be90
commit 1150873447
6 changed files with 31 additions and 35 deletions

View File

@@ -1,5 +1,5 @@
/*
** $Id: lfunc.c,v 2.36 2013/08/27 18:53:35 roberto Exp roberto $
** $Id: lfunc.c,v 2.37 2013/08/27 20:04:00 roberto Exp roberto $
** Auxiliary functions to manipulate prototypes and closures
** See Copyright Notice in lua.h
*/
@@ -21,14 +21,14 @@
Closure *luaF_newCclosure (lua_State *L, int n) {
Closure *c = &luaC_newobj(L, LUA_TCCL, sizeCclosure(n), NULL, 0)->cl;
Closure *c = &luaC_newobj(L, LUA_TCCL, sizeCclosure(n))->cl;
c->c.nupvalues = cast_byte(n);
return c;
}
Closure *luaF_newLclosure (lua_State *L, int n) {
Closure *c = &luaC_newobj(L, LUA_TLCL, sizeLclosure(n), NULL, 0)->cl;
Closure *c = &luaC_newobj(L, LUA_TLCL, sizeLclosure(n))->cl;
c->l.p = NULL;
c->l.nupvalues = cast_byte(n);
while (n--) c->l.upvals[n] = NULL;
@@ -85,7 +85,7 @@ void luaF_close (lua_State *L, StkId level) {
Proto *luaF_newproto (lua_State *L) {
Proto *f = &luaC_newobj(L, LUA_TPROTO, sizeof(Proto), &G(L)->allgc, 0)->p;
Proto *f = &luaC_newobj(L, LUA_TPROTO, sizeof(Proto))->p;
nolocal(obj2gco(f)); /* prototypes are never local */
f->k = NULL;
f->sizek = 0;