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

enh: added memory allocators for parser and planner

上级 2f475399
...@@ -250,8 +250,7 @@ typedef struct SRequestObj { ...@@ -250,8 +250,7 @@ typedef struct SRequestObj {
bool inRetry; bool inRetry;
uint32_t prevCode; // previous error code: todo refactor, add update flag for catalog uint32_t prevCode; // previous error code: todo refactor, add update flag for catalog
uint32_t retry; uint32_t retry;
// SNodeAllocator* pNodeAllocator; int64_t allocatorRefId;
int64_t allocatorRefId;
} SRequestObj; } SRequestObj;
typedef struct SSyncQueryParam { typedef struct SSyncQueryParam {
......
...@@ -288,6 +288,7 @@ void *createRequest(uint64_t connId, int32_t type) { ...@@ -288,6 +288,7 @@ void *createRequest(uint64_t connId, int32_t type) {
pRequest->body.resInfo.convertUcs4 = true; // convert ucs4 by default pRequest->body.resInfo.convertUcs4 = true; // convert ucs4 by default
pRequest->type = type; pRequest->type = type;
pRequest->allocatorRefId = -1;
pRequest->pDb = getDbOfConnection(pTscObj); pRequest->pDb = getDbOfConnection(pTscObj);
pRequest->pTscObj = pTscObj; pRequest->pTscObj = pTscObj;
......
...@@ -153,14 +153,14 @@ int32_t nodesCreateAllocator(int32_t chunkSize, int64_t* pRefId) { ...@@ -153,14 +153,14 @@ int32_t nodesCreateAllocator(int32_t chunkSize, int64_t* pRefId) {
} }
void nodesDestroyAllocator(int64_t refId) { void nodesDestroyAllocator(int64_t refId) {
if (refId < 0) { if (refId <= 0) {
return; return;
} }
taosReleaseRef(allocatorReqRefPool, refId); taosReleaseRef(allocatorReqRefPool, refId);
} }
void nodesResetAllocator(int64_t refId) { void nodesResetAllocator(int64_t refId) {
if (refId < 0) { if (refId <= 0) {
pNodeAllocator = NULL; pNodeAllocator = NULL;
} else { } else {
pNodeAllocator = taosAcquireRef(allocatorReqRefPool, refId); pNodeAllocator = taosAcquireRef(allocatorReqRefPool, refId);
...@@ -169,7 +169,7 @@ void nodesResetAllocator(int64_t refId) { ...@@ -169,7 +169,7 @@ void nodesResetAllocator(int64_t refId) {
} }
int64_t nodesIncAllocatorRefCount(int64_t refId) { int64_t nodesIncAllocatorRefCount(int64_t refId) {
if (refId < 0) { if (refId <= 0) {
return -1; return -1;
} }
SNodeAllocator* pAllocator = taosAcquireRef(allocatorReqRefPool, refId); SNodeAllocator* pAllocator = taosAcquireRef(allocatorReqRefPool, refId);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册