mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 12:20:41 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
883757b936 | ||
|
|
35e5a938b0 | ||
|
|
31d7b648b4 | ||
|
|
44e6693a40 |
@@ -1,3 +1,8 @@
|
|||||||
|
v0.7.4 (2014-10-13)
|
||||||
|
-----------
|
||||||
|
* Bugfix : clear coroutine pool when GC
|
||||||
|
* hotfix : A bug introduce by 0.7.3
|
||||||
|
|
||||||
v0.7.3 (2014-10-13)
|
v0.7.3 (2014-10-13)
|
||||||
-----------
|
-----------
|
||||||
* Add some logs (warning) when overload
|
* Add some logs (warning) when overload
|
||||||
|
|||||||
@@ -368,7 +368,7 @@ lunpack(lua_State *L) {
|
|||||||
lua_pushinteger(L, message->id);
|
lua_pushinteger(L, message->id);
|
||||||
lua_pushinteger(L, message->ud);
|
lua_pushinteger(L, message->ud);
|
||||||
if (message->buffer == NULL) {
|
if (message->buffer == NULL) {
|
||||||
lua_pushlstring(L, (char *)(message+1),size - sizeof(*message) - 1);
|
lua_pushlstring(L, (char *)(message+1),size - sizeof(*message));
|
||||||
} else {
|
} else {
|
||||||
lua_pushlightuserdata(L, message->buffer);
|
lua_pushlightuserdata(L, message->buffer);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -709,8 +709,15 @@ function skynet.term(service)
|
|||||||
return _error_dispatch(0, service)
|
return _error_dispatch(0, service)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function clear_pool()
|
||||||
|
coroutine_pool = {}
|
||||||
|
end
|
||||||
|
|
||||||
-- Inject internal debug framework
|
-- Inject internal debug framework
|
||||||
local debug = require "skynet.debug"
|
local debug = require "skynet.debug"
|
||||||
debug(skynet, dispatch_message)
|
debug(skynet, {
|
||||||
|
dispatch = dispatch_message,
|
||||||
|
clear = clear_pool,
|
||||||
|
})
|
||||||
|
|
||||||
return skynet
|
return skynet
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ local io = io
|
|||||||
local table = table
|
local table = table
|
||||||
local debug = debug
|
local debug = debug
|
||||||
|
|
||||||
return function (skynet, dispatch_func)
|
return function (skynet, export)
|
||||||
|
|
||||||
local internal_info_func
|
local internal_info_func
|
||||||
|
|
||||||
@@ -18,7 +18,7 @@ function dbgcmd.MEM()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function dbgcmd.GC()
|
function dbgcmd.GC()
|
||||||
coroutine_pool = {}
|
export.clear()
|
||||||
collectgarbage "collect"
|
collectgarbage "collect"
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -49,7 +49,7 @@ end
|
|||||||
|
|
||||||
function dbgcmd.RUN(source, filename)
|
function dbgcmd.RUN(source, filename)
|
||||||
local inject = require "skynet.inject"
|
local inject = require "skynet.inject"
|
||||||
local output = inject(source, filename , dispatch_func, skynet.register_protocol)
|
local output = inject(source, filename , export.dispatch, skynet.register_protocol)
|
||||||
collectgarbage "collect"
|
collectgarbage "collect"
|
||||||
skynet.ret(skynet.pack(table.concat(output, "\n")))
|
skynet.ret(skynet.pack(table.concat(output, "\n")))
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -36,10 +36,9 @@ forward_message(int type, bool padding, struct socket_message * result) {
|
|||||||
int sz = sizeof(*sm);
|
int sz = sizeof(*sm);
|
||||||
if (padding) {
|
if (padding) {
|
||||||
if (result->data) {
|
if (result->data) {
|
||||||
sz += strlen(result->data) + 1;
|
sz += strlen(result->data);
|
||||||
} else {
|
} else {
|
||||||
result->data = "";
|
result->data = "";
|
||||||
sz += 1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sm = (struct skynet_socket_message *)skynet_malloc(sz);
|
sm = (struct skynet_socket_message *)skynet_malloc(sz);
|
||||||
|
|||||||
Reference in New Issue
Block a user