From 2d71c389f67d4b95d5c59906aa8a9854f6b05a74 Mon Sep 17 00:00:00 2001 From: YuQing <384681@qq.com> Date: Tue, 20 Jul 2021 20:27:02 +0800 Subject: [PATCH] fast_mblock_init_ex1: unify obj name --- src/idempotency/client/client_channel.c | 4 ++-- src/idempotency/server/server_channel.c | 2 +- src/sf_binlog_writer.c | 2 +- src/sf_binlog_writer.h | 2 +- src/sf_connection_manager.c | 2 +- src/sf_sharding_htable.c | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/idempotency/client/client_channel.c b/src/idempotency/client/client_channel.c index cf7c0e3..8dc2d24 100644 --- a/src/idempotency/client/client_channel.c +++ b/src/idempotency/client/client_channel.c @@ -129,7 +129,7 @@ static int idempotency_channel_alloc_init(void *element, void *args) channel = (IdempotencyClientChannel *)element; if ((result=fast_mblock_init_ex1(&channel->receipt_allocator, - "idempotency_receipt", sizeof(IdempotencyClientReceipt), + "idempotency-receipt", sizeof(IdempotencyClientReceipt), 1024, 0, NULL, NULL, true)) != 0) { return result; @@ -153,7 +153,7 @@ int client_channel_init(IniFullContext *ini_ctx) } if ((result=fast_mblock_init_ex1(&channel_context.channel_allocator, - "channel_info", sizeof(IdempotencyClientChannel), + "channel-info", sizeof(IdempotencyClientChannel), 64, 0, idempotency_channel_alloc_init, NULL, true)) != 0) { return result; diff --git a/src/idempotency/server/server_channel.c b/src/idempotency/server/server_channel.c index 4ab0532..e0aaf36 100644 --- a/src/idempotency/server/server_channel.c +++ b/src/idempotency/server/server_channel.c @@ -100,7 +100,7 @@ int idempotency_channel_init(const uint32_t max_channel_id, element_size = sizeof(IdempotencyChannel) + sizeof(IdempotencyRequest *) * request_htable_capacity; if ((result=fast_mblock_init_ex1(&channel_context.channel_allocator, - "channel_info", element_size, 1024, max_channel_id, + "channel-info", element_size, 1024, max_channel_id, idempotency_channel_alloc_init, NULL, true)) != 0) { return result; diff --git a/src/sf_binlog_writer.c b/src/sf_binlog_writer.c index 473b0e0..87d569f 100644 --- a/src/sf_binlog_writer.c +++ b/src/sf_binlog_writer.c @@ -671,7 +671,7 @@ int sf_binlog_writer_init_thread_ex(SFBinlogWriterThread *thread, if (use_fixed_buffer_size) { element_size += max_record_size; } - if ((result=fast_mblock_init_ex1(&thread->mblock, "binlog_wbuffer", + if ((result=fast_mblock_init_ex1(&thread->mblock, "binlog-wbuffer", element_size, alloc_elements_once, 0, binlog_wbuffer_alloc_init, writer, true)) != 0) { diff --git a/src/sf_binlog_writer.h b/src/sf_binlog_writer.h index 5db1d99..c287066 100644 --- a/src/sf_binlog_writer.h +++ b/src/sf_binlog_writer.h @@ -68,7 +68,7 @@ typedef struct binlog_writer_thread { struct fast_mblock_man mblock; struct fc_queue queue; char name[64]; - bool running; + volatile bool running; bool use_fixed_buffer_size; short order_mode; short order_by; diff --git a/src/sf_connection_manager.c b/src/sf_connection_manager.c index 2f7e872..19931aa 100644 --- a/src/sf_connection_manager.c +++ b/src/sf_connection_manager.c @@ -861,7 +861,7 @@ int sf_connection_manager_prepare(SFConnectionManager *cm) element_size = sizeof(SFCMServerPtrArray) + sizeof(SFCMServerEntry *) * cm->max_servers_per_group; if ((result=fast_mblock_init_ex1(&cm->sptr_array_allocator, - "server_ptr_array", element_size, 4 * 1024, 0, + "server-ptr-array", element_size, 4 * 1024, 0, sptr_array_alloc_init, NULL, true)) != 0) { return result; diff --git a/src/sf_sharding_htable.c b/src/sf_sharding_htable.c index baeb40c..09080a6 100644 --- a/src/sf_sharding_htable.c +++ b/src/sf_sharding_htable.c @@ -45,7 +45,7 @@ static int init_allocators(SFHtableShardingContext *sharding_ctx, end = sharding_ctx->allocators.elts + allocator_count; for (pa=sharding_ctx->allocators.elts; pa