enh: added memory allocators for parser and planner

This commit is contained in:
Xiaoyu Wang 2022-09-21 11:28:34 +08:00
parent 2f475399a6
commit a914816ce7
3 changed files with 5 additions and 5 deletions

View File

@ -250,7 +250,6 @@ typedef struct SRequestObj {
bool inRetry;
uint32_t prevCode; // previous error code: todo refactor, add update flag for catalog
uint32_t retry;
// SNodeAllocator* pNodeAllocator;
int64_t allocatorRefId;
} SRequestObj;

View File

@ -288,6 +288,7 @@ void *createRequest(uint64_t connId, int32_t type) {
pRequest->body.resInfo.convertUcs4 = true; // convert ucs4 by default
pRequest->type = type;
pRequest->allocatorRefId = -1;
pRequest->pDb = getDbOfConnection(pTscObj);
pRequest->pTscObj = pTscObj;

View File

@ -153,14 +153,14 @@ int32_t nodesCreateAllocator(int32_t chunkSize, int64_t* pRefId) {
}
void nodesDestroyAllocator(int64_t refId) {
if (refId < 0) {
if (refId <= 0) {
return;
}
taosReleaseRef(allocatorReqRefPool, refId);
}
void nodesResetAllocator(int64_t refId) {
if (refId < 0) {
if (refId <= 0) {
pNodeAllocator = NULL;
} else {
pNodeAllocator = taosAcquireRef(allocatorReqRefPool, refId);
@ -169,7 +169,7 @@ void nodesResetAllocator(int64_t refId) {
}
int64_t nodesIncAllocatorRefCount(int64_t refId) {
if (refId < 0) {
if (refId <= 0) {
return -1;
}
SNodeAllocator* pAllocator = taosAcquireRef(allocatorReqRefPool, refId);