From 0bbdddc86b1353fec36ae886b4142986f3c4713f Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 17 Dec 2009 13:46:44 -0200 Subject: allocator function receives the tag of object being allocated in 'osize' when 'ptr' is NULL. --- ltable.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'ltable.c') diff --git a/ltable.c b/ltable.c index d6e8e526..287a5020 100644 --- a/ltable.c +++ b/ltable.c @@ -1,5 +1,5 @@ /* -** $Id: ltable.c,v 2.45 2009/11/19 17:54:07 roberto Exp roberto $ +** $Id: ltable.c,v 2.46 2009/11/26 11:39:20 roberto Exp roberto $ ** Lua tables (hash) ** See Copyright Notice in lua.h */ @@ -357,8 +357,7 @@ static void rehash (lua_State *L, Table *t, const TValue *ek) { Table *luaH_new (lua_State *L) { - Table *t = luaM_new(L, Table); - luaC_link(L, obj2gco(t), LUA_TTABLE); + Table *t = &luaC_newobj(L, LUA_TTABLE, sizeof(Table), NULL, 0)->h; t->metatable = NULL; t->flags = cast_byte(~0); t->array = NULL; -- cgit v1.2.3-55-g6feb