From 0f06fb97af83abd867311ce67c29e6dcc55137f5 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Tue, 9 Jun 2020 05:45:26 +0000 Subject: [PATCH] TD-353 --- src/tsdb/inc/tsdbMain.h | 4 ++-- src/tsdb/src/tsdbCache.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/tsdb/inc/tsdbMain.h b/src/tsdb/inc/tsdbMain.h index e06778a872..9601bbadfe 100644 --- a/src/tsdb/inc/tsdbMain.h +++ b/src/tsdb/inc/tsdbMain.h @@ -161,7 +161,7 @@ typedef struct { int64_t index; int numOfCacheBlocks; SList * memPool; -} STsdbCachePool; +} STsdbBufferPool; typedef struct { TSKEY keyFirst; @@ -173,7 +173,7 @@ typedef struct { typedef struct { int cacheBlockSize; int totalCacheBlocks; - STsdbCachePool pool; + STsdbBufferPool pool; STsdbCacheBlock *curBlock; SCacheMem * mem; SCacheMem * imem; diff --git a/src/tsdb/src/tsdbCache.c b/src/tsdb/src/tsdbCache.c index edc8472b34..24476d8997 100644 --- a/src/tsdb/src/tsdbCache.c +++ b/src/tsdb/src/tsdbCache.c @@ -35,7 +35,7 @@ STsdbCache *tsdbInitCache(int cacheBlockSize, int totalBlocks, TsdbRepoT *pRepo) pCache->totalCacheBlocks = totalBlocks; pCache->pRepo = pRepo; - STsdbCachePool *pPool = &(pCache->pool); + STsdbBufferPool *pPool = &(pCache->pool); pPool->index = 0; pPool->memPool = tdListNew(sizeof(STsdbCacheBlock *)); if (pPool->memPool == NULL) goto _err; @@ -106,7 +106,7 @@ static void tsdbFreeCacheMem(SCacheMem *mem) { } static int tsdbAllocBlockFromPool(STsdbCache *pCache) { - STsdbCachePool *pPool = &(pCache->pool); + STsdbBufferPool *pPool = &(pCache->pool); tsdbLockRepo(pCache->pRepo); if (listNEles(pPool->memPool) == 0) { @@ -170,7 +170,7 @@ int tsdbAlterCacheTotalBlocks(STsdbRepo *pRepo, int totalBlocks) { } static int tsdbAddCacheBlockToPool(STsdbCache *pCache) { - STsdbCachePool *pPool = &pCache->pool; + STsdbBufferPool *pPool = &pCache->pool; STsdbCacheBlock *pBlock = malloc(sizeof(STsdbCacheBlock) + pCache->cacheBlockSize); if (pBlock == NULL) return -1; @@ -184,7 +184,7 @@ static int tsdbAddCacheBlockToPool(STsdbCache *pCache) { } static int tsdbRemoveCacheBlockFromPool(STsdbCache *pCache) { - STsdbCachePool *pPool = &pCache->pool; + STsdbBufferPool *pPool = &pCache->pool; STsdbCacheBlock *pBlock = NULL; ASSERT(pCache->totalCacheBlocks >= 0);