private static int GetDeviceTotalMemorySize(IntPtr L) { int result; try { ToLua.CheckArgsCount(L, 1); PlatformUtil platformUtil = (PlatformUtil)ToLua.CheckObject(L, 1, typeof(PlatformUtil)); string deviceTotalMemorySize = platformUtil.GetDeviceTotalMemorySize(); LuaDLL.lua_pushstring(L, deviceTotalMemorySize); result = 1; } catch (Exception e) { result = LuaDLL.toluaL_exception(L, e, null); } return(result); }