自实现内存池:按大小分桶,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

18
memory/alloc_dispatch.h Normal file
View File

@@ -0,0 +1,18 @@
#ifndef __ALLOC_DISPATCH_H__
#define __ALLOC_DISPATCH_H__
#define MEMORY_USE_DEFAULT 0
#define MEMORY_USE_MYMALLOC 1
#define MEMORY_USE_JEMALLOC 2
#define MEMORY_SELECT_MALLOC MEMORY_USE_MYMALLOC
#include <stddef.h>
#include <stdint.h>
#include "mempool.h"
void *kvs_malloc(size_t size);
void kvs_free(void *ptr);
#endif