提交 21a5beab 编写于 作者: H Hongze Cheng

TD-353

上级 6413285b
......@@ -114,7 +114,7 @@ void tsdbCloseBufPool(STsdbRepo *pRepo) {
SListNode *tsdbAllocBufBlockFromPool(STsdbRepo *pRepo) {
ASSERT(pRepo != NULL && pRepo->pool != NULL);
// ASSERT pRepo is locked
ASSERT(IS_REPO_LOCKED(pRepo));
STsdbCfg * pCfg = &pRepo->config;
STsdbBufPool *pBufPool = pRepo->pool;
......
......@@ -170,6 +170,17 @@ static void *tsdbAllocBytes(STsdbRepo *pRepo, int bytes) {
tsdbUnRefMemTable(pRepo, pIMem);
}
} else {
if (tsdbLockRepo(pRepo) < 0) {
tsdbFreeMemTable(pMemTable);
return NULL;
}
SListNode *pNode = tsdbAllocBufBlockFromPool(pRepo);
tdListAppendNode(pMemTable->bufBlockList, pNode);
pRepo->mem = pMemTable;
if (tsdbUnlockRepo(pRepo) < 0) return NULL;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册