Add arrays to Lua (#222)

You can now have O(1) length and append.
This commit is contained in:
Paul Kulchenko 2021-08-06 04:55:01 -07:00 committed by GitHub
parent b142ea7176
commit 55a15c204e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 557 additions and 20 deletions

View file

@ -17,6 +17,7 @@
#include "third_party/lua/lstate.h"
#include "third_party/lua/lstring.h"
#include "third_party/lua/ltable.h"
#include "third_party/lua/larray.h"
#include "third_party/lua/ltm.h"
#include "third_party/lua/lua.h"
@ -777,6 +778,9 @@ static void freeobj (lua_State *L, GCObject *o) {
case LUA_VTABLE:
luaH_free(L, gco2t(o));
break;
case LUA_TARRAY:
luaA_free(L, gco2a(o));
break;
case LUA_VTHREAD:
luaE_freethread(L, gco2th(o));
break;