自实现内存池:按大小分桶,8bit跨度,支持释放。

resp协议pipline测试。
This commit is contained in:
1iaan
2026-01-25 10:07:11 +00:00
parent ba2004c258
commit 9e757ece87
22 changed files with 515 additions and 11388 deletions

View File

@@ -5,7 +5,7 @@
#include "kvs_rw_tools.h"
#include "kvs_protocol_resp.h"
#include "kvs_oplog.h"
#include "mem_pool/mem_pool.h"
#include "memory/alloc_dispatch.h"
#include "common/config.h"
#include "diskuring/diskuring.h"
@@ -140,13 +140,13 @@ int kvs_protocol(struct conn* conn){
int cap = KVS_MAX_RESPONSE - out_len;
if (cap <= 0) {
*response_length = out_len;
return -1;
return consumed;
}
int resp_len = resp_build_value(&val, response + out_len, (size_t)cap);
if (resp_len < 0) {
*response_length = out_len;
return -1;
return consumed;
}
out_len += resp_len;
@@ -372,7 +372,7 @@ void dest_kvengine(void) {
void init_memory_pool(void){
#if MEMORY_SELECT_MALLOC == MEMORY_USE_MYMALLOC
mp_init(&global_mempool);
mp_create(&global_mempool);
#endif
}