log管理器内存分配池化,修复部分log写入部分与内存池部分存在的恶性bug

This commit is contained in:
2026-02-21 15:04:04 +08:00
parent b618cc359a
commit d81a3c8042
16 changed files with 189 additions and 277 deletions

View File

@ -160,25 +160,11 @@ typedef struct internal_hooks
void *(CJSON_CDECL *reallocate)(void *pointer, size_t size);
} internal_hooks;
#if defined(_MSC_VER)
/* work around MSVC error C2322: '...' address of dllimport '...' is not static */
static void * CJSON_CDECL internal_malloc(size_t size)
{
return malloc(size);
}
static void CJSON_CDECL internal_free(void *pointer)
{
free(pointer);
}
static void * CJSON_CDECL internal_realloc(void *pointer, size_t size)
{
return realloc(pointer, size);
}
#else
#define internal_malloc malloc
#define internal_free free
#define internal_realloc realloc
#endif
/* strlen of character literals resolved at compile time */
#define static_strlen(string_literal) (sizeof(string_literal) - sizeof(""))