correct macro function sf_service_init
parent
a0f16319e0
commit
5ee8ce8fe7
|
|
@ -104,7 +104,7 @@ static int load_network_parameters(IniFullContext *ini_ctx,
|
|||
g_sf_global_vars.max_buff_size = g_sf_global_vars.max_pkg_size;
|
||||
} else {
|
||||
g_sf_global_vars.min_buff_size = iniGetByteCorrectValueEx(ini_ctx,
|
||||
"min_buff_size", SF_DEF_MIN_BUFF_SIZE, 1, 8192,
|
||||
"min_buff_size", SF_DEF_MIN_BUFF_SIZE, 1, 4096,
|
||||
SF_MAX_NETWORK_BUFF_SIZE, true);
|
||||
g_sf_global_vars.max_buff_size = iniGetByteCorrectValueEx(ini_ctx,
|
||||
"max_buff_size", SF_DEF_MAX_BUFF_SIZE, 1, 8192,
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ int sf_service_init_ex2(SFContext *sf_context, const char *name,
|
|||
proto_header_size, task_arg_size) \
|
||||
sf_service_init_ex2(sf_context, name, alloc_thread_extra_data_callback, \
|
||||
thread_loop_callback, accept_done_callback, set_body_length_func, \
|
||||
deal_func, task_cleanup_func, timeout_callback, net_timeout_ms, \
|
||||
NULL, deal_func, task_cleanup_func, timeout_callback, net_timeout_ms, \
|
||||
proto_header_size, task_arg_size, NULL, NULL)
|
||||
|
||||
#define sf_service_init(name, alloc_thread_extra_data_callback, \
|
||||
|
|
@ -60,7 +60,7 @@ int sf_service_init_ex2(SFContext *sf_context, const char *name,
|
|||
deal_func, task_cleanup_func, timeout_callback, net_timeout_ms, \
|
||||
proto_header_size, task_arg_size) \
|
||||
sf_service_init_ex2(&g_sf_context, name, alloc_thread_extra_data_callback, \
|
||||
thread_loop_callback, accept_done_callback, set_body_length_func, \
|
||||
thread_loop_callback, accept_done_callback, set_body_length_func, NULL, \
|
||||
deal_func, task_cleanup_func, timeout_callback, net_timeout_ms, \
|
||||
proto_header_size, task_arg_size, NULL, NULL)
|
||||
|
||||
|
|
|
|||
|
|
@ -70,13 +70,16 @@ static inline SFSharedMBuffer *sf_shared_mbuffer_alloc_ex(
|
|||
fc_sleep_ms(sleep_ms);
|
||||
}
|
||||
|
||||
logInfo("file: "__FILE__", line: %d, "
|
||||
"alloc shared buffer: %p, buff: %p",
|
||||
__LINE__, buffer, buffer->buff);
|
||||
|
||||
if (init_reffer_count > 0) {
|
||||
__sync_add_and_fetch(&buffer->reffer_count, init_reffer_count);
|
||||
}
|
||||
|
||||
/*
|
||||
logInfo("file: "__FILE__", line: %d, "
|
||||
"alloc shared buffer: %p, buff: %p, reffer_count: %d",
|
||||
__LINE__, buffer, buffer->buff, __sync_add_and_fetch(&buffer->reffer_count, 0));
|
||||
*/
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
|
|
@ -88,8 +91,10 @@ static inline void sf_shared_mbuffer_hold(SFSharedMBuffer *buffer)
|
|||
static inline void sf_shared_mbuffer_release(SFSharedMBuffer *buffer)
|
||||
{
|
||||
if (__sync_sub_and_fetch(&buffer->reffer_count, 1) == 0) {
|
||||
/*
|
||||
logInfo("file: "__FILE__", line: %d, "
|
||||
"free shared buffer: %p", __LINE__, buffer);
|
||||
*/
|
||||
fast_allocator_free(&buffer->ctx->allocator, buffer);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue