enh: add check for tpagebuf

This commit is contained in:
Cary Xu 2022-08-29 14:53:13 +08:00
parent fa0f6b50dc
commit 167e58578a
2 changed files with 2 additions and 5 deletions

View File

@ -295,11 +295,7 @@ int32_t tSimpleHashIterateRemove(SSHashObj *pHashObj, const void *key, size_t ke
}
if (*pIter == (void *)GET_SHASH_NODE_DATA(pNode)) {
if (!pPrev) {
*pIter = NULL;
} else {
*pIter = GET_SHASH_NODE_DATA(pPrev);
}
*pIter = pPrev ? GET_SHASH_NODE_DATA(pPrev) : NULL;
}
FREE_HASH_NODE(pNode);

View File

@ -465,6 +465,7 @@ void* getBufPage(SDiskbasedBuf* pBuf, int32_t id) {
// set the ptr to the new SPageInfo
((void**)((*pi)->pData))[0] = (*pi);
assert(listNEles(pBuf->lruList) < pBuf->inMemPages && pBuf->inMemPages > 0);
lruListPushFront(pBuf->lruList, *pi);
(*pi)->used = true;