提交 a914816c 编写于 作者: X Xiaoyu Wang

enh: added memory allocators for parser and planner

上级 2f475399
......@@ -250,8 +250,7 @@ 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;
int64_t allocatorRefId;
} SRequestObj;
typedef struct SSyncQueryParam {
......
......@@ -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;
......
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册