内存探测组件,预留热插拔。
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#define __CONFIG_H__
|
||||
|
||||
#include <stddef.h>
|
||||
#include <memory/alloc_dispatch.h>
|
||||
|
||||
typedef enum {
|
||||
LOG_LEVEL_DEBUG,
|
||||
@@ -19,11 +20,17 @@ typedef enum {
|
||||
PERSIST_NONE
|
||||
} PersistenceType;
|
||||
|
||||
typedef enum {
|
||||
ALLOC_JEMALLOC,
|
||||
ALLOC_MALLOC,
|
||||
ALLOC_OTHER
|
||||
} AllocatorType;
|
||||
// typedef enum {
|
||||
// ALLOC_JEMALLOC,
|
||||
// ALLOC_MALLOC,
|
||||
// ALLOC_MYPOOL,
|
||||
// ALLOC_OTHER
|
||||
// } AllocatorType;
|
||||
|
||||
// typedef enum {
|
||||
// MEMLEAK_DETECT_OFF = 0, // 关闭检测
|
||||
// MEMLEAK_DETECT_ON = 1 // 开启检测
|
||||
// } MemLeakDetectMode;
|
||||
|
||||
typedef struct {
|
||||
char ip[64];
|
||||
@@ -43,6 +50,7 @@ typedef struct {
|
||||
char hash_file[256];
|
||||
|
||||
AllocatorType allocator;
|
||||
MemLeakDetectMode leak_mode;
|
||||
} AppConfig;
|
||||
|
||||
/**
|
||||
@@ -55,5 +63,6 @@ const char *log_level_to_string(LogLevel lvl);
|
||||
const char *server_mode_to_string(ServerMode mode);
|
||||
const char *persistence_to_string(PersistenceType p);
|
||||
const char *allocator_to_string(AllocatorType a);
|
||||
const char *leakage_to_string(MemLeakDetectMode a);
|
||||
|
||||
#endif /* CONFIG_H */
|
||||
|
||||
Reference in New Issue
Block a user