diff --git a/include/sqrat/sqratTable.h b/include/sqrat/sqratTable.h index 1cc532bd..65e58b50 100644 --- a/include/sqrat/sqratTable.h +++ b/include/sqrat/sqratTable.h @@ -535,6 +535,20 @@ public: Table(HSQOBJECT o, HSQUIRRELVM v = DefaultVM::Get()) : TableBase(o, v) { } + ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + /// Construct the TableBase with an initial capacity + /// + /// \param v VM to create the Table in + /// \param c The initial capacity of the created table + /// + ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + Table(HSQUIRRELVM v, SQInteger c) : TableBase(v) { + sq_newtableex(vm, c); + sq_getstackobj(vm,-1,&obj); + sq_addref(vm, &obj); + sq_pop(vm,1); + } + ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// Copy constructor ///