bugfix issue #494

This commit is contained in:
Cloud Wu
2016-05-10 16:59:34 +08:00
parent 78df0b8161
commit e9f397945d
2 changed files with 21 additions and 15 deletions

View File

@@ -1,17 +1,23 @@
local skynet = require "skynet"
local names = {"cluster", "dns", "mongo", "mysql", "redis", "sharedata", "socket", "sproto"}
-- set sandbox memory limit to 1M, must set here (at start, out of skynet.start)
skynet.memlimit(1 * 1024 * 1024)
skynet.start(function()
local a = {}
local limit
local ok, err = pcall(function()
for i=1, 1000000 do
limit = i
table.insert(a, {})
end
end)
skynet.error(limit, err)
skynet.exit()
local a = {}
local limit
local ok, err = pcall(function()
for i=1, 12355 do
limit = i
table.insert(a, {})
end
end)
local libs = {}
for k,v in ipairs(names) do
libs[v] = require(v)
end
skynet.error(limit, err)
skynet.exit()
end)