THRIFT-2882 Lua Generator: using string.len funtion to get struct(map,list,set) size
diff --git a/lib/lua/Thrift.lua b/lib/lua/Thrift.lua
index da5bb63..a9a9078 100644
--- a/lib/lua/Thrift.lua
+++ b/lib/lua/Thrift.lua
@@ -40,6 +40,14 @@
   error(e)
 end
 
+function ttable_size(t)
+  local count = 0
+  for k, v in pairs(t) do
+    count = count + 1
+  end
+  return count
+end
+
 version = 1.0
 
 TType = {