This commit is contained in:
hzcheng 2020-03-21 13:36:54 +08:00
parent 194d37a35f
commit dca2abd6fb
1 changed files with 2 additions and 2 deletions

View File

@ -70,7 +70,7 @@ void *tsdbAllocFromCache(STsdbCache *pCache, int bytes) {
if (pCache == NULL) return NULL; if (pCache == NULL) return NULL;
if (bytes > pCache->cacheBlockSize) return NULL; if (bytes > pCache->cacheBlockSize) return NULL;
if (isListEmpty(pCache->imem)) { if (isListEmpty(pCache->mem)) {
if (tsdbAllocBlockFromPool(pCache) < 0) { if (tsdbAllocBlockFromPool(pCache) < 0) {
// TODO: deal with the error // TODO: deal with the error
} }
@ -114,7 +114,7 @@ static int tsdbAllocBlockFromPool(STsdbCache *pCache) {
pBlock->offset = 0; pBlock->offset = 0;
pBlock->remain = pCache->cacheBlockSize; pBlock->remain = pCache->cacheBlockSize;
tdListAppendNode(pPool->memPool, node); tdListAppendNode(pCache->mem, node);
pCache->curBlock = pBlock; pCache->curBlock = pBlock;
return 0; return 0;