自实现内存池:按大小分桶,8bit跨度,支持释放。
resp协议pipline测试。
This commit is contained in:
18
memory/alloc_dispatch.h
Normal file
18
memory/alloc_dispatch.h
Normal 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
|
||||
Reference in New Issue
Block a user