mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-23 19:43:09 +00:00
bugfix issue #494
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user