If you really want the table size, you have to walk the whole table (using next() or pairs() in Lua or lua_next() in C).