From d5139804f9bf18effa99f08a32c6a36b588b4c71 Mon Sep 17 00:00:00 2001 From: YuQing <384681@qq.com> Date: Fri, 19 May 2023 11:21:15 +0800 Subject: [PATCH] adapt newest fast_mblock_init_ex2 --- src/sf_binlog_writer.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/sf_binlog_writer.c b/src/sf_binlog_writer.c index 2181ea0..fca9dd4 100644 --- a/src/sf_binlog_writer.c +++ b/src/sf_binlog_writer.c @@ -439,6 +439,8 @@ int sf_binlog_writer_init_thread_ex(SFBinlogWriterThread *thread, const bool passive_write) { const int alloc_elements_once = 1024; + const int64_t alloc_elements_limit = 0; + const int prealloc_trunk_count = 0; int result; int element_size; pthread_t tid; @@ -461,8 +463,8 @@ int sf_binlog_writer_init_thread_ex(SFBinlogWriterThread *thread, callbacks.destroy_func = binlog_wbuffer_destroy_func; } if ((result=fast_mblock_init_ex2(&thread->mblock, "binlog-wbuffer", - element_size, alloc_elements_once, 0, - &callbacks, true, NULL)) != 0) + element_size, alloc_elements_once, alloc_elements_limit, + prealloc_trunk_count, &callbacks, true, NULL)) != 0) { return result; }