diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2003-10-10 10:29:28 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2003-10-10 10:29:28 -0300 |
commit | 10de467c794a536902755c236933623767bb452e (patch) | |
tree | bc0577eb71a887170abd07d8b7f52eade4518175 /lapi.c | |
parent | 533737f26e3f8036d7978e09427ea5ff75aec9df (diff) | |
download | lua-10de467c794a536902755c236933623767bb452e.tar.gz lua-10de467c794a536902755c236933623767bb452e.tar.bz2 lua-10de467c794a536902755c236933623767bb452e.zip |
new function `lua_createtable'
Diffstat (limited to 'lapi.c')
-rw-r--r-- | lapi.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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 | ||
535 | LUA_API void lua_newtable (lua_State *L) { | 535 | LUA_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 | } |