mirror of
https://github.com/lua/lua
synced 2026-09-29 04:35:58 +03:00
new function `lua_createtable'
This commit is contained in:
parent
533737f26e
commit
10de467c79
4 changed files with 13 additions and 12 deletions
6
lapi.c
6
lapi.c
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
** $Id: lapi.c,v 1.245 2003/10/07 20:13:41 roberto Exp roberto $
|
||||
** $Id: lapi.c,v 1.246 2003/10/10 12:57:55 roberto Exp roberto $
|
||||
** Lua API
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
|
|
@ -532,10 +532,10 @@ LUA_API void lua_rawgeti (lua_State *L, int idx, int n) {
|
|||
}
|
||||
|
||||
|
||||
LUA_API void lua_newtable (lua_State *L) {
|
||||
LUA_API void lua_createtable (lua_State *L, int narray, int nrec) {
|
||||
lua_lock(L);
|
||||
luaC_checkGC(L);
|
||||
sethvalue(L->top, luaH_new(L, 0, 0));
|
||||
sethvalue(L->top, luaH_new(L, narray, luaO_log2(nrec) + 1));
|
||||
api_incr_top(L);
|
||||
lua_unlock(L);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue