revert and remove allocator

This commit is contained in:
Liu Jicong 2022-01-20 15:25:13 +08:00
parent 3203e8fe42
commit 6bf4614bfa
2 changed files with 6 additions and 2 deletions

View File

@ -58,15 +58,19 @@ STQ* tqOpen(const char* path, STqCfg* tqConfig, SMemAllocatorFactory* allocFac)
} }
pTq->path = strdup(path); pTq->path = strdup(path);
pTq->tqConfig = tqConfig; pTq->tqConfig = tqConfig;
#if 0
pTq->tqMemRef.pAllocatorFactory = allocFac; pTq->tqMemRef.pAllocatorFactory = allocFac;
pTq->tqMemRef.pAllocator = allocFac->create(allocFac); pTq->tqMemRef.pAllocator = allocFac->create(allocFac);
if (pTq->tqMemRef.pAllocator == NULL) { if (pTq->tqMemRef.pAllocator == NULL) {
// TODO: error code of buffer pool // TODO: error code of buffer pool
} }
#endif
pTq->tqMeta = tqStoreOpen(path, (FTqSerialize)tqSerializeGroup, (FTqDeserialize)tqDeserializeGroup, free, 0); pTq->tqMeta = tqStoreOpen(path, (FTqSerialize)tqSerializeGroup, (FTqDeserialize)tqDeserializeGroup, free, 0);
if (pTq->tqMeta == NULL) { if (pTq->tqMeta == NULL) {
allocFac->destroy(allocFac, pTq->tqMemRef.pAllocator);
free(pTq); free(pTq);
#if 0
allocFac->destroy(allocFac, pTq->tqMemRef.pAllocator);
#endif
return NULL; return NULL;
} }

View File

@ -117,7 +117,7 @@ static int vnodeOpenImpl(SVnode *pVnode) {
return -1; return -1;
} }
// TODO: Open TQ // Open TQ
sprintf(dir, "%s/tq", pVnode->path); sprintf(dir, "%s/tq", pVnode->path);
pVnode->pTq = tqOpen(dir, &(pVnode->config.tqCfg), vBufPoolGetMAF(pVnode)); pVnode->pTq = tqOpen(dir, &(pVnode->config.tqCfg), vBufPoolGetMAF(pVnode));
if (pVnode->pTq == NULL) { if (pVnode->pTq == NULL) {