aboutsummaryrefslogtreecommitdiff
path: root/lapi.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2003-10-10 10:29:28 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2003-10-10 10:29:28 -0300
commit10de467c794a536902755c236933623767bb452e (patch)
treebc0577eb71a887170abd07d8b7f52eade4518175 /lapi.c
parent533737f26e3f8036d7978e09427ea5ff75aec9df (diff)
downloadlua-10de467c794a536902755c236933623767bb452e.tar.gz
lua-10de467c794a536902755c236933623767bb452e.tar.bz2
lua-10de467c794a536902755c236933623767bb452e.zip
new function `lua_createtable'
Diffstat (limited to 'lapi.c')
-rw-r--r--lapi.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lapi.c b/lapi.c
index 16686e7e..2e5366ba 100644
--- a/lapi.c
+++ b/lapi.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lapi.c,v 1.245 2003/10/07 20:13:41 roberto Exp roberto $ 2** $Id: lapi.c,v 1.246 2003/10/10 12:57:55 roberto Exp roberto $
3** Lua API 3** Lua API
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -532,10 +532,10 @@ LUA_API void lua_rawgeti (lua_State *L, int idx, int n) {
532} 532}
533 533
534 534
535LUA_API void lua_newtable (lua_State *L) { 535LUA_API void lua_createtable (lua_State *L, int narray, int nrec) {
536 lua_lock(L); 536 lua_lock(L);
537 luaC_checkGC(L); 537 luaC_checkGC(L);
538 sethvalue(L->top, luaH_new(L, 0, 0)); 538 sethvalue(L->top, luaH_new(L, narray, luaO_log2(nrec) + 1));
539 api_incr_top(L); 539 api_incr_top(L);
540 lua_unlock(L); 540 lua_unlock(L);
541} 541}