提交 5c5d6eb1 编写于 作者: H Hongze Cheng

refact

上级 140e2abc
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
#include "mallocator.h" #include "mallocator.h"
#include "sync.h" #include "sync.h"
#include "tlockfree.h"
#include "vnode.h" #include "vnode.h"
#include "vnodeAllocatorPool.h" #include "vnodeAllocatorPool.h"
#include "vnodeCommit.h" #include "vnodeCommit.h"
......
...@@ -15,12 +15,47 @@ ...@@ -15,12 +15,47 @@
#include "vnodeDef.h" #include "vnodeDef.h"
/* ------------------------ Heap Allocator ------------------------ */
typedef struct { typedef struct {
uint64_t tsize; uint64_t tsize;
uint64_t used; uint64_t used;
} SVHeapAllocator; } SVHeapAllocator;
typedef struct SVArenaNode {
struct SVArenaNode *prev;
} SVArenaNode;
typedef struct {
} SVArenaAllocator;
typedef struct {
int8_t type;
uint64_t tsize;
T_REF_DECLARE()
union {
SVHeapAllocator vha;
SVArenaAllocator vaa;
};
} SVMemAllocator;
SMemAllocator *vnodeCreateMemAllocator(int8_t type, uint64_t size) {
/* TODO */
return NULL;
}
void vnodeDestroyMemAllocator(SMemAllocator *pma) {
// TODO
}
void vnodeRefMemAllocator(SMemAllocator *pma) {
// TODO
}
void vnodeUnrefMemAllocator(SMemAllocator *pma) {
// TODO
}
/* ------------------------ Heap Allocator IMPL ------------------------ */
SMemAllocator *vhaCreate(uint64_t size) { SMemAllocator *vhaCreate(uint64_t size) {
SMemAllocator *pma; SMemAllocator *pma;
...@@ -62,6 +97,4 @@ static uint64_t vhaUsage(SMemAllocator *pma) { ...@@ -62,6 +97,4 @@ static uint64_t vhaUsage(SMemAllocator *pma) {
return 0; return 0;
} }
/* ------------------------ Arena Allocator ------------------------ */ /* ------------------------ Arena Allocator IMPL ------------------------ */
typedef struct { \ No newline at end of file
} SVArenaAllocator;
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册