实现内存池的测试用例、继承jemalloc和自实现内存池。

This commit is contained in:
2026-01-09 20:09:05 +08:00
parent 4b4e06b33d
commit 1adb24482b
16 changed files with 664 additions and 436 deletions

View File

@@ -1,5 +1,6 @@
#include "kvstore.h"
#include "kvs_rw_tools.h"
#include "mem_pool/mem_pool.h"
#include <arpa/inet.h>
#include <fcntl.h>
#include <unistd.h>
@@ -14,6 +15,7 @@ int init_cmd_log(const char *file, int *logfd){
}
int destroy_cmd_log(int logfd){
fsync(logfd);
close(logfd);
return 0;
}
@@ -35,9 +37,6 @@ int kvs_save_cmd_to_logfile(const uint8_t *cmd, size_t len, int logfd){
if (write_full(logfd, cmd, len) < 0)
return -4;
if (fsync(logfd) < 0)
return -5;
return 0;
}