From 6889e19bf931eb23b19139ae5c27a782668fd7d3 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Mon, 28 Feb 2022 10:23:16 +0800 Subject: [PATCH] rename file --- include/util/{mallocator.h => tmallocator.h} | 12 ++++++------ source/dnode/vnode/inc/meta.h | 3 +-- source/dnode/vnode/inc/tq.h | 3 +-- source/dnode/vnode/inc/tsdb.h | 2 +- source/dnode/vnode/src/inc/metaDef.h | 2 +- source/dnode/vnode/src/inc/tsdbDef.h | 2 +- source/dnode/vnode/src/inc/vnd.h | 2 +- source/util/src/{mallocator.c => tmallocator.c} | 3 ++- 8 files changed, 14 insertions(+), 15 deletions(-) rename include/util/{mallocator.h => tmallocator.h} (85%) rename source/util/src/{mallocator.c => tmallocator.c} (98%) diff --git a/include/util/mallocator.h b/include/util/tmallocator.h similarity index 85% rename from include/util/mallocator.h rename to include/util/tmallocator.h index 5ecdc316a4..e9eb3e1b72 100644 --- a/include/util/mallocator.h +++ b/include/util/tmallocator.h @@ -13,8 +13,8 @@ * along with this program. If not, see . */ -#ifndef _TD_MALLOCATOR_H_ -#define _TD_MALLOCATOR_H_ +#ifndef _TD_UTIL_MALLOCATOR_H_ +#define _TD_UTIL_MALLOCATOR_H_ #include "os.h" @@ -29,10 +29,10 @@ extern "C" { void (*free_)(struct TYPE *, void *ptr); \ } #define TD_MA_MALLOC_FUNC(TMA) (TMA)->malloc_ -#define TD_MA_FREE_FUNC(TMA) (TMA)->free_ +#define TD_MA_FREE_FUNC(TMA) (TMA)->free_ #define TD_MA_MALLOC(TMA, SIZE) (*((TMA)->malloc_))(TMA, (SIZE)) -#define TD_MA_FREE(TMA, PTR) (*((TMA)->free_))(TMA, (PTR)) +#define TD_MA_FREE(TMA, PTR) (*((TMA)->free_))(TMA, (PTR)) typedef struct SMemAllocator { void *impl; @@ -40,7 +40,7 @@ typedef struct SMemAllocator { } SMemAllocator; #define tMalloc(pMA, SIZE) TD_MA_MALLOC(PMA, SIZE) -#define tFree(pMA, PTR) TD_MA_FREE(PMA, PTR) +#define tFree(pMA, PTR) TD_MA_FREE(PMA, PTR) typedef struct SMemAllocatorFactory { void *impl; @@ -52,4 +52,4 @@ typedef struct SMemAllocatorFactory { } #endif -#endif /*_TD_MALLOCATOR_H_*/ \ No newline at end of file +#endif /*_TD_UTIL_MALLOCATOR_H_*/ \ No newline at end of file diff --git a/source/dnode/vnode/inc/meta.h b/source/dnode/vnode/inc/meta.h index 44a352ec54..c98a97d0dc 100644 --- a/source/dnode/vnode/inc/meta.h +++ b/source/dnode/vnode/inc/meta.h @@ -16,8 +16,7 @@ #ifndef _TD_META_H_ #define _TD_META_H_ -#include "mallocator.h" -#include "os.h" +#include "tmallocator.h" #include "tmsg.h" #include "trow.h" diff --git a/source/dnode/vnode/inc/tq.h b/source/dnode/vnode/inc/tq.h index a516f423bb..f4d3b405d9 100644 --- a/source/dnode/vnode/inc/tq.h +++ b/source/dnode/vnode/inc/tq.h @@ -18,9 +18,8 @@ #include "common.h" #include "executor.h" -#include "mallocator.h" +#include "tmallocator.h" #include "meta.h" -#include "os.h" #include "scheduler.h" #include "taoserror.h" #include "tlist.h" diff --git a/source/dnode/vnode/inc/tsdb.h b/source/dnode/vnode/inc/tsdb.h index 7bdd8fc266..d578c8b12a 100644 --- a/source/dnode/vnode/inc/tsdb.h +++ b/source/dnode/vnode/inc/tsdb.h @@ -16,7 +16,7 @@ #ifndef _TD_TSDB_H_ #define _TD_TSDB_H_ -#include "mallocator.h" +#include "tmallocator.h" #include "meta.h" #include "common.h" #include "tfs.h" diff --git a/source/dnode/vnode/src/inc/metaDef.h b/source/dnode/vnode/src/inc/metaDef.h index b76c08b7b4..f4128f7170 100644 --- a/source/dnode/vnode/src/inc/metaDef.h +++ b/source/dnode/vnode/src/inc/metaDef.h @@ -16,7 +16,7 @@ #ifndef _TD_META_DEF_H_ #define _TD_META_DEF_H_ -#include "mallocator.h" +#include "tmallocator.h" #include "meta.h" diff --git a/source/dnode/vnode/src/inc/tsdbDef.h b/source/dnode/vnode/src/inc/tsdbDef.h index 55e16218ad..98c0de32a8 100644 --- a/source/dnode/vnode/src/inc/tsdbDef.h +++ b/source/dnode/vnode/src/inc/tsdbDef.h @@ -16,7 +16,7 @@ #ifndef _TD_TSDB_DEF_H_ #define _TD_TSDB_DEF_H_ -#include "mallocator.h" +#include "tmallocator.h" #include "meta.h" #include "tcompression.h" #include "tglobal.h" diff --git a/source/dnode/vnode/src/inc/vnd.h b/source/dnode/vnode/src/inc/vnd.h index fb81ddbc5c..75088687a8 100644 --- a/source/dnode/vnode/src/inc/vnd.h +++ b/source/dnode/vnode/src/inc/vnd.h @@ -16,7 +16,7 @@ #ifndef _TD_VNODE_DEF_H_ #define _TD_VNODE_DEF_H_ -#include "mallocator.h" +#include "tmallocator.h" // #include "sync.h" #include "tcoding.h" #include "tfs.h" diff --git a/source/util/src/mallocator.c b/source/util/src/tmallocator.c similarity index 98% rename from source/util/src/mallocator.c rename to source/util/src/tmallocator.c index a56fbfa597..057b908a58 100644 --- a/source/util/src/mallocator.c +++ b/source/util/src/tmallocator.c @@ -13,7 +13,8 @@ * along with this program. If not, see . */ -#include "mallocator.h" +#define _DEFAULT_SOURCE +#include "tmallocator.h" /* ------------------------ HEAP ALLOCATOR ------------------------ */ #if 0