add function fast_mblock_set_exceed_log_level

vote_node
YuQing 2022-05-31 18:39:52 +08:00
parent 64e9499de6
commit 793d683d2a
2 changed files with 14 additions and 3 deletions

View File

@ -250,6 +250,15 @@ static inline int fast_mblock_set_need_wait(struct fast_mblock_man *mblock,
return 0;
}
static inline void fast_mblock_set_exceed_log_level(
struct fast_mblock_man *mblock, const int log_level)
{
mblock->alloc_elements.exceed_log_level = log_level;
}
#define fast_mblock_set_exceed_silence(mblock) \
fast_mblock_set_exceed_log_level(mblock, LOG_NOTHING)
/**
alloc a node from the mblock
parameters:

View File

@ -23,6 +23,7 @@
#include <string.h>
#include <time.h>
#include "common_define.h"
#include "shared_func.h"
#define FC_JSON_TYPE_STRING 1
#define FC_JSON_TYPE_ARRAY 2
@ -117,7 +118,7 @@ extern "C" {
*ctx->error_info.str = '\0';
}
static inline void fc_init_json_context_ex(fc_json_context_t *ctx,
static inline int fc_init_json_context_ex(fc_json_context_t *ctx,
const int init_buff_size, char *error_info, const int error_size)
{
ctx->output.buff = NULL;
@ -133,12 +134,13 @@ extern "C" {
ctx->error_no = 0;
fc_set_json_error_buffer(ctx, error_info, error_size);
return 0;
}
static inline void fc_init_json_context(fc_json_context_t *ctx)
static inline int fc_init_json_context(fc_json_context_t *ctx)
{
const int init_buff_size = 0;
fc_init_json_context_ex(ctx, init_buff_size, NULL, 0);
return fc_init_json_context_ex(ctx, init_buff_size, NULL, 0);
}
static inline void fc_destroy_json_context(fc_json_context_t *ctx)