fix: memory param over
This commit is contained in:
parent
f126e1e3b0
commit
f80dbfb6f5
|
@ -230,7 +230,7 @@ int32_t cloneTableMeta(STableMeta* pSrc, STableMeta** pDst);
|
||||||
int32_t cloneDbVgInfo(SDBVgInfo* pSrc, SDBVgInfo** pDst);
|
int32_t cloneDbVgInfo(SDBVgInfo* pSrc, SDBVgInfo** pDst);
|
||||||
|
|
||||||
extern int32_t (*queryBuildMsg[TDMT_MAX])(void* input, char** msg, int32_t msgSize, int32_t* msgLen,
|
extern int32_t (*queryBuildMsg[TDMT_MAX])(void* input, char** msg, int32_t msgSize, int32_t* msgLen,
|
||||||
void* (*mallocFp)(int32_t));
|
void* (*mallocFp)(int64_t));
|
||||||
extern int32_t (*queryProcessMsgRsp[TDMT_MAX])(void* output, char* msg, int32_t msgSize);
|
extern int32_t (*queryProcessMsgRsp[TDMT_MAX])(void* output, char* msg, int32_t msgSize);
|
||||||
|
|
||||||
#define SET_META_TYPE_NULL(t) (t) = META_TYPE_NULL_TABLE
|
#define SET_META_TYPE_NULL(t) (t) = META_TYPE_NULL_TABLE
|
||||||
|
|
|
@ -123,9 +123,9 @@ void rpcCleanup();
|
||||||
void *rpcOpen(const SRpcInit *pRpc);
|
void *rpcOpen(const SRpcInit *pRpc);
|
||||||
void rpcClose(void *);
|
void rpcClose(void *);
|
||||||
void rpcCloseImpl(void *);
|
void rpcCloseImpl(void *);
|
||||||
void *rpcMallocCont(int32_t contLen);
|
void *rpcMallocCont(int64_t contLen);
|
||||||
void rpcFreeCont(void *pCont);
|
void rpcFreeCont(void *pCont);
|
||||||
void *rpcReallocCont(void *ptr, int32_t contLen);
|
void *rpcReallocCont(void *ptr, int64_t contLen);
|
||||||
|
|
||||||
// Because taosd supports multi-process mode
|
// Because taosd supports multi-process mode
|
||||||
// These functions should not be used on the server side
|
// These functions should not be used on the server side
|
||||||
|
|
|
@ -29,12 +29,12 @@ extern "C" {
|
||||||
#define free FREE_FUNC_TAOS_FORBID
|
#define free FREE_FUNC_TAOS_FORBID
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void *taosMemoryMalloc(int32_t size);
|
void *taosMemoryMalloc(int64_t size);
|
||||||
void *taosMemoryCalloc(int32_t num, int32_t size);
|
void *taosMemoryCalloc(int64_t num, int64_t size);
|
||||||
void *taosMemoryRealloc(void *ptr, int32_t size);
|
void *taosMemoryRealloc(void *ptr, int64_t size);
|
||||||
void *taosMemoryStrDup(const char *ptr);
|
void *taosMemoryStrDup(const char *ptr);
|
||||||
void taosMemoryFree(void *ptr);
|
void taosMemoryFree(void *ptr);
|
||||||
int32_t taosMemorySize(void *ptr);
|
int64_t taosMemorySize(void *ptr);
|
||||||
void taosPrintBackTrace();
|
void taosPrintBackTrace();
|
||||||
|
|
||||||
#define taosMemoryFreeClear(ptr) \
|
#define taosMemoryFreeClear(ptr) \
|
||||||
|
|
|
@ -638,7 +638,7 @@ int32_t ctgGetQnodeListFromMnode(SCatalog* pCtg, SRequestConnInfo* pConn, SArray
|
||||||
char* msg = NULL;
|
char* msg = NULL;
|
||||||
int32_t msgLen = 0;
|
int32_t msgLen = 0;
|
||||||
int32_t reqType = TDMT_MND_QNODE_LIST;
|
int32_t reqType = TDMT_MND_QNODE_LIST;
|
||||||
void* (*mallocFp)(int32_t) = pTask ? taosMemoryMalloc : rpcMallocCont;
|
void* (*mallocFp)(int64_t) = pTask ? taosMemoryMalloc : rpcMallocCont;
|
||||||
|
|
||||||
ctgDebug("try to get qnode list from mnode, mgmtEpInUse:%d", pConn->mgmtEps.inUse);
|
ctgDebug("try to get qnode list from mnode, mgmtEpInUse:%d", pConn->mgmtEps.inUse);
|
||||||
|
|
||||||
|
@ -692,7 +692,7 @@ int32_t ctgGetDnodeListFromMnode(SCatalog* pCtg, SRequestConnInfo* pConn, SArray
|
||||||
char* msg = NULL;
|
char* msg = NULL;
|
||||||
int32_t msgLen = 0;
|
int32_t msgLen = 0;
|
||||||
int32_t reqType = TDMT_MND_DNODE_LIST;
|
int32_t reqType = TDMT_MND_DNODE_LIST;
|
||||||
void* (*mallocFp)(int32_t) = pTask ? taosMemoryMalloc : rpcMallocCont;
|
void* (*mallocFp)(int64_t) = pTask ? taosMemoryMalloc : rpcMallocCont;
|
||||||
|
|
||||||
ctgDebug("try to get dnode list from mnode, mgmtEpInUse:%d", pConn->mgmtEps.inUse);
|
ctgDebug("try to get dnode list from mnode, mgmtEpInUse:%d", pConn->mgmtEps.inUse);
|
||||||
|
|
||||||
|
@ -743,7 +743,7 @@ int32_t ctgGetDBVgInfoFromMnode(SCatalog* pCtg, SRequestConnInfo* pConn, SBuildU
|
||||||
int32_t msgLen = 0;
|
int32_t msgLen = 0;
|
||||||
int32_t reqType = TDMT_MND_USE_DB;
|
int32_t reqType = TDMT_MND_USE_DB;
|
||||||
SCtgTask* pTask = tReq ? tReq->pTask : NULL;
|
SCtgTask* pTask = tReq ? tReq->pTask : NULL;
|
||||||
void* (*mallocFp)(int32_t) = pTask ? taosMemoryMalloc : rpcMallocCont;
|
void* (*mallocFp)(int64_t) = pTask ? taosMemoryMalloc : rpcMallocCont;
|
||||||
|
|
||||||
ctgDebug("try to get db vgInfo from mnode, dbFName:%s", input->db);
|
ctgDebug("try to get db vgInfo from mnode, dbFName:%s", input->db);
|
||||||
|
|
||||||
|
@ -795,7 +795,7 @@ int32_t ctgGetDBCfgFromMnode(SCatalog* pCtg, SRequestConnInfo* pConn, const char
|
||||||
char* msg = NULL;
|
char* msg = NULL;
|
||||||
int32_t msgLen = 0;
|
int32_t msgLen = 0;
|
||||||
int32_t reqType = TDMT_MND_GET_DB_CFG;
|
int32_t reqType = TDMT_MND_GET_DB_CFG;
|
||||||
void* (*mallocFp)(int32_t) = pTask ? taosMemoryMalloc : rpcMallocCont;
|
void* (*mallocFp)(int64_t) = pTask ? taosMemoryMalloc : rpcMallocCont;
|
||||||
|
|
||||||
ctgDebug("try to get db cfg from mnode, dbFName:%s", dbFName);
|
ctgDebug("try to get db cfg from mnode, dbFName:%s", dbFName);
|
||||||
|
|
||||||
|
@ -850,7 +850,7 @@ int32_t ctgGetIndexInfoFromMnode(SCatalog* pCtg, SRequestConnInfo* pConn, const
|
||||||
char* msg = NULL;
|
char* msg = NULL;
|
||||||
int32_t msgLen = 0;
|
int32_t msgLen = 0;
|
||||||
int32_t reqType = TDMT_MND_GET_INDEX;
|
int32_t reqType = TDMT_MND_GET_INDEX;
|
||||||
void* (*mallocFp)(int32_t) = pTask ? taosMemoryMalloc : rpcMallocCont;
|
void* (*mallocFp)(int64_t) = pTask ? taosMemoryMalloc : rpcMallocCont;
|
||||||
|
|
||||||
ctgDebug("try to get index from mnode, indexName:%s", indexName);
|
ctgDebug("try to get index from mnode, indexName:%s", indexName);
|
||||||
|
|
||||||
|
@ -905,7 +905,7 @@ int32_t ctgGetTbIndexFromMnode(SCatalog* pCtg, SRequestConnInfo* pConn, SName* n
|
||||||
char* msg = NULL;
|
char* msg = NULL;
|
||||||
int32_t msgLen = 0;
|
int32_t msgLen = 0;
|
||||||
int32_t reqType = TDMT_MND_GET_TABLE_INDEX;
|
int32_t reqType = TDMT_MND_GET_TABLE_INDEX;
|
||||||
void* (*mallocFp)(int32_t) = pTask ? taosMemoryMalloc : rpcMallocCont;
|
void* (*mallocFp)(int64_t) = pTask ? taosMemoryMalloc : rpcMallocCont;
|
||||||
char tbFName[TSDB_TABLE_FNAME_LEN];
|
char tbFName[TSDB_TABLE_FNAME_LEN];
|
||||||
tNameExtractFullName(name, tbFName);
|
tNameExtractFullName(name, tbFName);
|
||||||
|
|
||||||
|
@ -962,7 +962,7 @@ int32_t ctgGetUdfInfoFromMnode(SCatalog* pCtg, SRequestConnInfo* pConn, const ch
|
||||||
char* msg = NULL;
|
char* msg = NULL;
|
||||||
int32_t msgLen = 0;
|
int32_t msgLen = 0;
|
||||||
int32_t reqType = TDMT_MND_RETRIEVE_FUNC;
|
int32_t reqType = TDMT_MND_RETRIEVE_FUNC;
|
||||||
void* (*mallocFp)(int32_t) = pTask ? taosMemoryMalloc : rpcMallocCont;
|
void* (*mallocFp)(int64_t) = pTask ? taosMemoryMalloc : rpcMallocCont;
|
||||||
|
|
||||||
ctgDebug("try to get udf info from mnode, funcName:%s", funcName);
|
ctgDebug("try to get udf info from mnode, funcName:%s", funcName);
|
||||||
|
|
||||||
|
@ -1017,7 +1017,7 @@ int32_t ctgGetUserDbAuthFromMnode(SCatalog* pCtg, SRequestConnInfo* pConn, const
|
||||||
char* msg = NULL;
|
char* msg = NULL;
|
||||||
int32_t msgLen = 0;
|
int32_t msgLen = 0;
|
||||||
int32_t reqType = TDMT_MND_GET_USER_AUTH;
|
int32_t reqType = TDMT_MND_GET_USER_AUTH;
|
||||||
void* (*mallocFp)(int32_t) = pTask ? taosMemoryMalloc : rpcMallocCont;
|
void* (*mallocFp)(int64_t) = pTask ? taosMemoryMalloc : rpcMallocCont;
|
||||||
|
|
||||||
ctgDebug("try to get user auth from mnode, user:%s", user);
|
ctgDebug("try to get user auth from mnode, user:%s", user);
|
||||||
|
|
||||||
|
@ -1077,7 +1077,7 @@ int32_t ctgGetTbMetaFromMnodeImpl(SCatalog* pCtg, SRequestConnInfo* pConn, char*
|
||||||
int32_t reqType = TDMT_MND_TABLE_META;
|
int32_t reqType = TDMT_MND_TABLE_META;
|
||||||
char tbFName[TSDB_TABLE_FNAME_LEN];
|
char tbFName[TSDB_TABLE_FNAME_LEN];
|
||||||
sprintf(tbFName, "%s.%s", dbFName, tbName);
|
sprintf(tbFName, "%s.%s", dbFName, tbName);
|
||||||
void* (*mallocFp)(int32_t) = pTask ? taosMemoryMalloc : rpcMallocCont;
|
void* (*mallocFp)(int64_t) = pTask ? taosMemoryMalloc : rpcMallocCont;
|
||||||
|
|
||||||
ctgDebug("try to get table meta from mnode, tbFName:%s", tbFName);
|
ctgDebug("try to get table meta from mnode, tbFName:%s", tbFName);
|
||||||
|
|
||||||
|
@ -1140,7 +1140,7 @@ int32_t ctgGetTbMetaFromVnode(SCatalog* pCtg, SRequestConnInfo* pConn, const SNa
|
||||||
int32_t reqType = TDMT_VND_TABLE_META;
|
int32_t reqType = TDMT_VND_TABLE_META;
|
||||||
char tbFName[TSDB_TABLE_FNAME_LEN];
|
char tbFName[TSDB_TABLE_FNAME_LEN];
|
||||||
sprintf(tbFName, "%s.%s", dbFName, pTableName->tname);
|
sprintf(tbFName, "%s.%s", dbFName, pTableName->tname);
|
||||||
void* (*mallocFp)(int32_t) = pTask ? taosMemoryMalloc : rpcMallocCont;
|
void* (*mallocFp)(int64_t) = pTask ? taosMemoryMalloc : rpcMallocCont;
|
||||||
|
|
||||||
SEp* pEp = &vgroupInfo->epSet.eps[vgroupInfo->epSet.inUse];
|
SEp* pEp = &vgroupInfo->epSet.eps[vgroupInfo->epSet.inUse];
|
||||||
ctgDebug("try to get table meta from vnode, vgId:%d, ep num:%d, ep %s:%d, tbFName:%s", vgroupInfo->vgId,
|
ctgDebug("try to get table meta from vnode, vgId:%d, ep num:%d, ep %s:%d, tbFName:%s", vgroupInfo->vgId,
|
||||||
|
@ -1209,7 +1209,7 @@ int32_t ctgGetTableCfgFromVnode(SCatalog* pCtg, SRequestConnInfo* pConn, const S
|
||||||
int32_t reqType = TDMT_VND_TABLE_CFG;
|
int32_t reqType = TDMT_VND_TABLE_CFG;
|
||||||
char tbFName[TSDB_TABLE_FNAME_LEN];
|
char tbFName[TSDB_TABLE_FNAME_LEN];
|
||||||
tNameExtractFullName(pTableName, tbFName);
|
tNameExtractFullName(pTableName, tbFName);
|
||||||
void* (*mallocFp)(int32_t) = pTask ? taosMemoryMalloc : rpcMallocCont;
|
void* (*mallocFp)(int64_t) = pTask ? taosMemoryMalloc : rpcMallocCont;
|
||||||
char dbFName[TSDB_DB_FNAME_LEN];
|
char dbFName[TSDB_DB_FNAME_LEN];
|
||||||
tNameGetFullDbName(pTableName, dbFName);
|
tNameGetFullDbName(pTableName, dbFName);
|
||||||
SBuildTableInput bInput = {.vgId = vgroupInfo->vgId, .dbFName = dbFName, .tbName = (char*)pTableName->tname};
|
SBuildTableInput bInput = {.vgId = vgroupInfo->vgId, .dbFName = dbFName, .tbName = (char*)pTableName->tname};
|
||||||
|
@ -1274,7 +1274,7 @@ int32_t ctgGetTableCfgFromMnode(SCatalog* pCtg, SRequestConnInfo* pConn, const S
|
||||||
int32_t reqType = TDMT_MND_TABLE_CFG;
|
int32_t reqType = TDMT_MND_TABLE_CFG;
|
||||||
char tbFName[TSDB_TABLE_FNAME_LEN];
|
char tbFName[TSDB_TABLE_FNAME_LEN];
|
||||||
tNameExtractFullName(pTableName, tbFName);
|
tNameExtractFullName(pTableName, tbFName);
|
||||||
void* (*mallocFp)(int32_t) = pTask ? taosMemoryMalloc : rpcMallocCont;
|
void* (*mallocFp)(int64_t) = pTask ? taosMemoryMalloc : rpcMallocCont;
|
||||||
char dbFName[TSDB_DB_FNAME_LEN];
|
char dbFName[TSDB_DB_FNAME_LEN];
|
||||||
tNameGetFullDbName(pTableName, dbFName);
|
tNameGetFullDbName(pTableName, dbFName);
|
||||||
SBuildTableInput bInput = {.vgId = 0, .dbFName = dbFName, .tbName = (char*)pTableName->tname};
|
SBuildTableInput bInput = {.vgId = 0, .dbFName = dbFName, .tbName = (char*)pTableName->tname};
|
||||||
|
@ -1326,7 +1326,7 @@ int32_t ctgGetSvrVerFromMnode(SCatalog* pCtg, SRequestConnInfo* pConn, char** ou
|
||||||
char* msg = NULL;
|
char* msg = NULL;
|
||||||
int32_t msgLen = 0;
|
int32_t msgLen = 0;
|
||||||
int32_t reqType = TDMT_MND_SERVER_VERSION;
|
int32_t reqType = TDMT_MND_SERVER_VERSION;
|
||||||
void* (*mallocFp)(int32_t) = pTask ? taosMemoryMalloc : rpcMallocCont;
|
void* (*mallocFp)(int64_t) = pTask ? taosMemoryMalloc : rpcMallocCont;
|
||||||
|
|
||||||
qDebug("try to get svr ver from mnode");
|
qDebug("try to get svr ver from mnode");
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int32_t (*queryBuildMsg[TDMT_MAX])(void *input, char **msg, int32_t msgSize, int32_t *msgLen,
|
int32_t (*queryBuildMsg[TDMT_MAX])(void *input, char **msg, int32_t msgSize, int32_t *msgLen,
|
||||||
void *(*mallocFp)(int32_t)) = {0};
|
void *(*mallocFp)(int64_t)) = {0};
|
||||||
int32_t (*queryProcessMsgRsp[TDMT_MAX])(void *output, char *msg, int32_t msgSize) = {0};
|
int32_t (*queryProcessMsgRsp[TDMT_MAX])(void *output, char *msg, int32_t msgSize) = {0};
|
||||||
|
|
||||||
int32_t queryBuildUseDbOutput(SUseDbOutput *pOut, SUseDbRsp *usedbRsp) {
|
int32_t queryBuildUseDbOutput(SUseDbOutput *pOut, SUseDbRsp *usedbRsp) {
|
||||||
|
@ -68,7 +68,7 @@ int32_t queryBuildUseDbOutput(SUseDbOutput *pOut, SUseDbRsp *usedbRsp) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t queryBuildTableMetaReqMsg(void *input, char **msg, int32_t msgSize, int32_t *msgLen,
|
int32_t queryBuildTableMetaReqMsg(void *input, char **msg, int32_t msgSize, int32_t *msgLen,
|
||||||
void *(*mallcFp)(int32_t)) {
|
void *(*mallcFp)(int64_t)) {
|
||||||
SBuildTableInput *pInput = input;
|
SBuildTableInput *pInput = input;
|
||||||
if (NULL == input || NULL == msg || NULL == msgLen) {
|
if (NULL == input || NULL == msg || NULL == msgLen) {
|
||||||
return TSDB_CODE_TSC_INVALID_INPUT;
|
return TSDB_CODE_TSC_INVALID_INPUT;
|
||||||
|
@ -91,7 +91,7 @@ int32_t queryBuildTableMetaReqMsg(void *input, char **msg, int32_t msgSize, int3
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t queryBuildUseDbMsg(void *input, char **msg, int32_t msgSize, int32_t *msgLen, void *(*mallcFp)(int32_t)) {
|
int32_t queryBuildUseDbMsg(void *input, char **msg, int32_t msgSize, int32_t *msgLen, void *(*mallcFp)(int64_t)) {
|
||||||
SBuildUseDBInput *pInput = input;
|
SBuildUseDBInput *pInput = input;
|
||||||
if (NULL == pInput || NULL == msg || NULL == msgLen) {
|
if (NULL == pInput || NULL == msg || NULL == msgLen) {
|
||||||
return TSDB_CODE_TSC_INVALID_INPUT;
|
return TSDB_CODE_TSC_INVALID_INPUT;
|
||||||
|
@ -114,7 +114,7 @@ int32_t queryBuildUseDbMsg(void *input, char **msg, int32_t msgSize, int32_t *ms
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t queryBuildQnodeListMsg(void *input, char **msg, int32_t msgSize, int32_t *msgLen, void *(*mallcFp)(int32_t)) {
|
int32_t queryBuildQnodeListMsg(void *input, char **msg, int32_t msgSize, int32_t *msgLen, void *(*mallcFp)(int64_t)) {
|
||||||
if (NULL == msg || NULL == msgLen) {
|
if (NULL == msg || NULL == msgLen) {
|
||||||
return TSDB_CODE_TSC_INVALID_INPUT;
|
return TSDB_CODE_TSC_INVALID_INPUT;
|
||||||
}
|
}
|
||||||
|
@ -132,7 +132,7 @@ int32_t queryBuildQnodeListMsg(void *input, char **msg, int32_t msgSize, int32_t
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t queryBuildDnodeListMsg(void *input, char **msg, int32_t msgSize, int32_t *msgLen, void *(*mallcFp)(int32_t)) {
|
int32_t queryBuildDnodeListMsg(void *input, char **msg, int32_t msgSize, int32_t *msgLen, void *(*mallcFp)(int64_t)) {
|
||||||
if (NULL == msg || NULL == msgLen) {
|
if (NULL == msg || NULL == msgLen) {
|
||||||
return TSDB_CODE_TSC_INVALID_INPUT;
|
return TSDB_CODE_TSC_INVALID_INPUT;
|
||||||
}
|
}
|
||||||
|
@ -150,7 +150,7 @@ int32_t queryBuildDnodeListMsg(void *input, char **msg, int32_t msgSize, int32_t
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t queryBuildGetSerVerMsg(void *input, char **msg, int32_t msgSize, int32_t *msgLen, void *(*mallcFp)(int32_t)) {
|
int32_t queryBuildGetSerVerMsg(void *input, char **msg, int32_t msgSize, int32_t *msgLen, void *(*mallcFp)(int64_t)) {
|
||||||
if (NULL == msg || NULL == msgLen) {
|
if (NULL == msg || NULL == msgLen) {
|
||||||
return TSDB_CODE_TSC_INVALID_INPUT;
|
return TSDB_CODE_TSC_INVALID_INPUT;
|
||||||
}
|
}
|
||||||
|
@ -167,7 +167,7 @@ int32_t queryBuildGetSerVerMsg(void *input, char **msg, int32_t msgSize, int32_t
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t queryBuildGetDBCfgMsg(void *input, char **msg, int32_t msgSize, int32_t *msgLen, void *(*mallcFp)(int32_t)) {
|
int32_t queryBuildGetDBCfgMsg(void *input, char **msg, int32_t msgSize, int32_t *msgLen, void *(*mallcFp)(int64_t)) {
|
||||||
if (NULL == msg || NULL == msgLen) {
|
if (NULL == msg || NULL == msgLen) {
|
||||||
return TSDB_CODE_TSC_INVALID_INPUT;
|
return TSDB_CODE_TSC_INVALID_INPUT;
|
||||||
}
|
}
|
||||||
|
@ -185,7 +185,7 @@ int32_t queryBuildGetDBCfgMsg(void *input, char **msg, int32_t msgSize, int32_t
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t queryBuildGetIndexMsg(void *input, char **msg, int32_t msgSize, int32_t *msgLen, void *(*mallcFp)(int32_t)) {
|
int32_t queryBuildGetIndexMsg(void *input, char **msg, int32_t msgSize, int32_t *msgLen, void *(*mallcFp)(int64_t)) {
|
||||||
if (NULL == msg || NULL == msgLen) {
|
if (NULL == msg || NULL == msgLen) {
|
||||||
return TSDB_CODE_TSC_INVALID_INPUT;
|
return TSDB_CODE_TSC_INVALID_INPUT;
|
||||||
}
|
}
|
||||||
|
@ -204,7 +204,7 @@ int32_t queryBuildGetIndexMsg(void *input, char **msg, int32_t msgSize, int32_t
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t queryBuildRetrieveFuncMsg(void *input, char **msg, int32_t msgSize, int32_t *msgLen,
|
int32_t queryBuildRetrieveFuncMsg(void *input, char **msg, int32_t msgSize, int32_t *msgLen,
|
||||||
void *(*mallcFp)(int32_t)) {
|
void *(*mallcFp)(int64_t)) {
|
||||||
if (NULL == msg || NULL == msgLen) {
|
if (NULL == msg || NULL == msgLen) {
|
||||||
return TSDB_CODE_TSC_INVALID_INPUT;
|
return TSDB_CODE_TSC_INVALID_INPUT;
|
||||||
}
|
}
|
||||||
|
@ -227,7 +227,7 @@ int32_t queryBuildRetrieveFuncMsg(void *input, char **msg, int32_t msgSize, int3
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t queryBuildGetUserAuthMsg(void *input, char **msg, int32_t msgSize, int32_t *msgLen, void *(*mallcFp)(int32_t)) {
|
int32_t queryBuildGetUserAuthMsg(void *input, char **msg, int32_t msgSize, int32_t *msgLen, void *(*mallcFp)(int64_t)) {
|
||||||
if (NULL == msg || NULL == msgLen) {
|
if (NULL == msg || NULL == msgLen) {
|
||||||
return TSDB_CODE_TSC_INVALID_INPUT;
|
return TSDB_CODE_TSC_INVALID_INPUT;
|
||||||
}
|
}
|
||||||
|
@ -245,7 +245,7 @@ int32_t queryBuildGetUserAuthMsg(void *input, char **msg, int32_t msgSize, int32
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t queryBuildGetTbIndexMsg(void *input, char **msg, int32_t msgSize, int32_t *msgLen, void *(*mallcFp)(int32_t)) {
|
int32_t queryBuildGetTbIndexMsg(void *input, char **msg, int32_t msgSize, int32_t *msgLen, void *(*mallcFp)(int64_t)) {
|
||||||
if (NULL == msg || NULL == msgLen) {
|
if (NULL == msg || NULL == msgLen) {
|
||||||
return TSDB_CODE_TSC_INVALID_INPUT;
|
return TSDB_CODE_TSC_INVALID_INPUT;
|
||||||
}
|
}
|
||||||
|
@ -263,7 +263,7 @@ int32_t queryBuildGetTbIndexMsg(void *input, char **msg, int32_t msgSize, int32_
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t queryBuildGetTbCfgMsg(void *input, char **msg, int32_t msgSize, int32_t *msgLen, void *(*mallcFp)(int32_t)) {
|
int32_t queryBuildGetTbCfgMsg(void *input, char **msg, int32_t msgSize, int32_t *msgLen, void *(*mallcFp)(int64_t)) {
|
||||||
if (NULL == msg || NULL == msgLen) {
|
if (NULL == msg || NULL == msgLen) {
|
||||||
return TSDB_CODE_TSC_INVALID_INPUT;
|
return TSDB_CODE_TSC_INVALID_INPUT;
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,8 +100,8 @@ void rpcCloseImpl(void* arg) {
|
||||||
taosMemoryFree(pRpc);
|
taosMemoryFree(pRpc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void* rpcMallocCont(int32_t contLen) {
|
void* rpcMallocCont(int64_t contLen) {
|
||||||
int32_t size = contLen + TRANS_MSG_OVERHEAD;
|
int64_t size = contLen + TRANS_MSG_OVERHEAD;
|
||||||
char* start = taosMemoryCalloc(1, size);
|
char* start = taosMemoryCalloc(1, size);
|
||||||
if (start == NULL) {
|
if (start == NULL) {
|
||||||
tError("failed to malloc msg, size:%d", size);
|
tError("failed to malloc msg, size:%d", size);
|
||||||
|
@ -120,11 +120,11 @@ void rpcFreeCont(void* cont) {
|
||||||
tTrace("rpc free cont:%p", (char*)cont - TRANS_MSG_OVERHEAD);
|
tTrace("rpc free cont:%p", (char*)cont - TRANS_MSG_OVERHEAD);
|
||||||
}
|
}
|
||||||
|
|
||||||
void* rpcReallocCont(void* ptr, int32_t contLen) {
|
void* rpcReallocCont(void* ptr, int64_t contLen) {
|
||||||
if (ptr == NULL) return rpcMallocCont(contLen);
|
if (ptr == NULL) return rpcMallocCont(contLen);
|
||||||
|
|
||||||
char* st = (char*)ptr - TRANS_MSG_OVERHEAD;
|
char* st = (char*)ptr - TRANS_MSG_OVERHEAD;
|
||||||
int32_t sz = contLen + TRANS_MSG_OVERHEAD;
|
int64_t sz = contLen + TRANS_MSG_OVERHEAD;
|
||||||
st = taosMemoryRealloc(st, sz);
|
st = taosMemoryRealloc(st, sz);
|
||||||
if (st == NULL) {
|
if (st == NULL) {
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
||||||
|
|
|
@ -228,7 +228,7 @@ void taosPrintBackTrace() {
|
||||||
void taosPrintBackTrace() { return; }
|
void taosPrintBackTrace() { return; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void *taosMemoryMalloc(int32_t size) {
|
void *taosMemoryMalloc(int64_t size) {
|
||||||
#ifdef USE_TD_MEMORY
|
#ifdef USE_TD_MEMORY
|
||||||
void *tmp = malloc(size + sizeof(TdMemoryInfo));
|
void *tmp = malloc(size + sizeof(TdMemoryInfo));
|
||||||
if (tmp == NULL) return NULL;
|
if (tmp == NULL) return NULL;
|
||||||
|
@ -244,7 +244,7 @@ void *taosMemoryMalloc(int32_t size) {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void *taosMemoryCalloc(int32_t num, int32_t size) {
|
void *taosMemoryCalloc(int64_t num, int64_t size) {
|
||||||
#ifdef USE_TD_MEMORY
|
#ifdef USE_TD_MEMORY
|
||||||
int32_t memorySize = num * size;
|
int32_t memorySize = num * size;
|
||||||
char *tmp = calloc(memorySize + sizeof(TdMemoryInfo), 1);
|
char *tmp = calloc(memorySize + sizeof(TdMemoryInfo), 1);
|
||||||
|
@ -261,7 +261,7 @@ void *taosMemoryCalloc(int32_t num, int32_t size) {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void *taosMemoryRealloc(void *ptr, int32_t size) {
|
void *taosMemoryRealloc(void *ptr, int64_t size) {
|
||||||
#ifdef USE_TD_MEMORY
|
#ifdef USE_TD_MEMORY
|
||||||
if (ptr == NULL) return taosMemoryMalloc(size);
|
if (ptr == NULL) return taosMemoryMalloc(size);
|
||||||
|
|
||||||
|
@ -318,7 +318,7 @@ void taosMemoryFree(void *ptr) {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t taosMemorySize(void *ptr) {
|
int64_t taosMemorySize(void *ptr) {
|
||||||
if (ptr == NULL) return 0;
|
if (ptr == NULL) return 0;
|
||||||
|
|
||||||
#ifdef USE_TD_MEMORY
|
#ifdef USE_TD_MEMORY
|
||||||
|
|
Loading…
Reference in New Issue