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 5ecdc316a490aa1be7b57ec68d00b7653cebf864..e9eb3e1b727755fdcf34f5b9c78771362d6a0b6e 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 44a352ec54966af9a1cb13c767cc8a23988395c6..c98a97d0dc19d669980a0baa2370243b22aebdf3 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 a516f423bbeb6c9df5746da932977d299c6ec856..f4d3b405d951f3481a4e68a68f748719d78eb675 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 7bdd8fc266ac9900bb6e719f65de87beb2e68a06..d578c8b12a521aad2c213cf84cd8c31fd2850322 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 b76c08b7b4a9a59081e3de6eac70b8e1aedafe15..f4128f7170675633664f1cb6f6685563eaccf70c 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 55e16218ad71fffc89306489d9b2d260ce93f4f7..98c0de32a851fdfc1d50366f77dfaf8d16303f61 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 fb81ddbc5ce992c699faa4cecf1d0d16a429fbcd..75088687a810ea461daaa04793005518c0e659b7 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 a56fbfa5976dfcaaad681ecfda47ad8a1d415a6e..057b908a583f297227982a8f101ab97a7ebe891a 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