From c8ee7ba9a7bc3d1ddb1c34d0983ce461bd266e53 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Tue, 9 Nov 2021 14:36:53 +0800 Subject: [PATCH] refact --- include/server/vnode/vnode.h | 2 ++ source/dnode/vnode/impl/inc/vnodeAllocatorPool.h | 3 +-- source/dnode/vnode/impl/inc/vnodeMemAllocator.h | 3 --- source/dnode/vnode/impl/inc/vnodeSync.h | 2 ++ source/dnode/vnode/impl/src/vnodeAllocatorPool.c | 14 +++++++++++++- 5 files changed, 18 insertions(+), 6 deletions(-) diff --git a/include/server/vnode/vnode.h b/include/server/vnode/vnode.h index 44f8ffdc66..58894ca957 100644 --- a/include/server/vnode/vnode.h +++ b/include/server/vnode/vnode.h @@ -52,6 +52,8 @@ struct SVnodeOptions { // STqOptions tqOptions; // TODO }; +/* ------------------------ FOR COMPILE ------------------------ */ + #if 1 #include "taosmsg.h" diff --git a/source/dnode/vnode/impl/inc/vnodeAllocatorPool.h b/source/dnode/vnode/impl/inc/vnodeAllocatorPool.h index 66790f8bb5..9fe4cbefca 100644 --- a/source/dnode/vnode/impl/inc/vnodeAllocatorPool.h +++ b/source/dnode/vnode/impl/inc/vnodeAllocatorPool.h @@ -17,7 +17,6 @@ #define _TD_VNODE_ALLOCATOR_POOL_H_ #include "vnode.h" -#include "vnodeMemAllocator.h" #ifdef __cplusplus extern "C" { @@ -26,7 +25,7 @@ extern "C" { typedef struct { int nexta; int enda; - SVMemAllocator allocators[3]; + SMemAllocator *allocators[3]; } SVAllocatorPool; int vnodeOpenAllocatorPool(SVnode *pVnode); diff --git a/source/dnode/vnode/impl/inc/vnodeMemAllocator.h b/source/dnode/vnode/impl/inc/vnodeMemAllocator.h index 784c70dd68..7e9bd21fe3 100644 --- a/source/dnode/vnode/impl/inc/vnodeMemAllocator.h +++ b/source/dnode/vnode/impl/inc/vnodeMemAllocator.h @@ -20,9 +20,6 @@ extern "C" { #endif -typedef struct { -} SVMemAllocator; - #ifdef __cplusplus } #endif diff --git a/source/dnode/vnode/impl/inc/vnodeSync.h b/source/dnode/vnode/impl/inc/vnodeSync.h index 712958bf56..a3eb004dfa 100644 --- a/source/dnode/vnode/impl/inc/vnodeSync.h +++ b/source/dnode/vnode/impl/inc/vnodeSync.h @@ -16,6 +16,8 @@ #ifndef _TD_VNODE_SYNC_H_ #define _TD_VNODE_SYNC_H_ +#include "sync.h" + #ifdef __cplusplus extern "C" { #endif diff --git a/source/dnode/vnode/impl/src/vnodeAllocatorPool.c b/source/dnode/vnode/impl/src/vnodeAllocatorPool.c index 82dad85add..b5617210a0 100644 --- a/source/dnode/vnode/impl/src/vnodeAllocatorPool.c +++ b/source/dnode/vnode/impl/src/vnodeAllocatorPool.c @@ -21,5 +21,17 @@ int vnodeOpenAllocatorPool(SVnode *pVnode) { } void vnodeCloseAllocatorPool(SVnode *pVnode) { - // TODO + if (pVnode->pool) { + } +} + +/* ------------------------ STATIC METHODS ------------------------ */ +static SVAllocatorPool *vapCreate() { + SVAllocatorPool *pPool = NULL; + /* TODO */ + return pPool; +} + +static void vapDestroy() { + // TODO } \ No newline at end of file -- GitLab