mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-25 12:43:09 +00:00
bugfix issue #494
This commit is contained in:
@@ -492,15 +492,19 @@ static int marksharedproto (global_State *g, SharedProto *f) {
|
|||||||
** NULL, so the use of 'markobjectN')
|
** NULL, so the use of 'markobjectN')
|
||||||
*/
|
*/
|
||||||
static int traverseproto (global_State *g, Proto *f) {
|
static int traverseproto (global_State *g, Proto *f) {
|
||||||
int i;
|
int i,nk,np;
|
||||||
if (f->cache && iswhite(f->cache))
|
if (f->cache && iswhite(f->cache))
|
||||||
f->cache = NULL; /* allow cache to be collected */
|
f->cache = NULL; /* allow cache to be collected */
|
||||||
for (i = 0; i < f->sp->sizek; i++) /* mark literals */
|
if (f->sp == NULL)
|
||||||
|
return sizeof(Proto);
|
||||||
|
nk = (f->k == NULL) ? 0 : f->sp->sizek;
|
||||||
|
np = (f->p == NULL) ? 0 : f->sp->sizep;
|
||||||
|
for (i = 0; i < nk; i++) /* mark literals */
|
||||||
markvalue(g, &f->k[i]);
|
markvalue(g, &f->k[i]);
|
||||||
for (i = 0; i < f->sp->sizep; i++) /* mark nested protos */
|
for (i = 0; i < np; i++) /* mark nested protos */
|
||||||
markobjectN(g, f->p[i]);
|
markobjectN(g, f->p[i]);
|
||||||
return sizeof(Proto) + sizeof(Proto *) * f->sp->sizep +
|
return sizeof(Proto) + sizeof(Proto *) * np +
|
||||||
sizeof(TValue) * f->sp->sizek +
|
sizeof(TValue) * nk +
|
||||||
marksharedproto(g, f->sp);
|
marksharedproto(g, f->sp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,10 @@ skynet.start(function()
|
|||||||
end)
|
end)
|
||||||
local libs = {}
|
local libs = {}
|
||||||
for k,v in ipairs(names) do
|
for k,v in ipairs(names) do
|
||||||
libs[v] = require(v)
|
local ok, m = pcall(require, v)
|
||||||
|
if ok then
|
||||||
|
libs[v] = m
|
||||||
|
end
|
||||||
end
|
end
|
||||||
skynet.error(limit, err)
|
skynet.error(limit, err)
|
||||||
skynet.exit()
|
skynet.exit()
|
||||||
|
|||||||
Reference in New Issue
Block a user