From b42cb82b1c3d2171dd1ebae72f883050a5739a27 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Wed, 22 Dec 2021 13:43:32 +0800 Subject: [PATCH] refact --- source/dnode/vnode/impl/inc/vnodeMemAllocator.h | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/source/dnode/vnode/impl/inc/vnodeMemAllocator.h b/source/dnode/vnode/impl/inc/vnodeMemAllocator.h index bdafbf31a7..eb821a4b6c 100644 --- a/source/dnode/vnode/impl/inc/vnodeMemAllocator.h +++ b/source/dnode/vnode/impl/inc/vnodeMemAllocator.h @@ -22,17 +22,14 @@ extern "C" { #endif -typedef struct SVArenaNode SVArenaNode; -typedef struct SVMemAllocator SVMemAllocator; - -struct SVArenaNode { +typedef struct SVArenaNode { TD_SLIST_NODE(SVArenaNode); uint64_t size; // current node size void * ptr; char data[]; -}; +} SVArenaNode; -struct SVMemAllocator { +typedef struct SVMemAllocator { T_REF_DECLARE() TD_DLIST_NODE(SVMemAllocator); uint64_t capacity; @@ -40,7 +37,7 @@ struct SVMemAllocator { uint64_t lsize; SVArenaNode *pNode; TD_SLIST(SVArenaNode) nlist; -}; +} SVMemAllocator; SVMemAllocator *vmaCreate(uint64_t capacity, uint64_t ssize, uint64_t lsize); void vmaDestroy(SVMemAllocator *pVMA); -- GitLab