Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
f80dbfb6
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
f80dbfb6
编写于
10月 13, 2022
作者:
wafwerar
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: memory param over
上级
f126e1e3
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
43 addition
and
43 deletion
+43
-43
include/libs/qcom/query.h
include/libs/qcom/query.h
+1
-1
include/libs/transport/trpc.h
include/libs/transport/trpc.h
+2
-2
include/os/osMemory.h
include/os/osMemory.h
+4
-4
source/libs/catalog/src/ctgRemote.c
source/libs/catalog/src/ctgRemote.c
+13
-13
source/libs/qcom/src/querymsg.c
source/libs/qcom/src/querymsg.c
+15
-15
source/libs/transport/src/trans.c
source/libs/transport/src/trans.c
+4
-4
source/os/src/osMemory.c
source/os/src/osMemory.c
+4
-4
未找到文件。
include/libs/qcom/query.h
浏览文件 @
f80dbfb6
...
...
@@ -230,7 +230,7 @@ int32_t cloneTableMeta(STableMeta* pSrc, STableMeta** pDst);
int32_t
cloneDbVgInfo
(
SDBVgInfo
*
pSrc
,
SDBVgInfo
**
pDst
);
extern
int32_t
(
*
queryBuildMsg
[
TDMT_MAX
])(
void
*
input
,
char
**
msg
,
int32_t
msgSize
,
int32_t
*
msgLen
,
void
*
(
*
mallocFp
)(
int
32
_t
));
void
*
(
*
mallocFp
)(
int
64
_t
));
extern
int32_t
(
*
queryProcessMsgRsp
[
TDMT_MAX
])(
void
*
output
,
char
*
msg
,
int32_t
msgSize
);
#define SET_META_TYPE_NULL(t) (t) = META_TYPE_NULL_TABLE
...
...
include/libs/transport/trpc.h
浏览文件 @
f80dbfb6
...
...
@@ -123,9 +123,9 @@ void rpcCleanup();
void
*
rpcOpen
(
const
SRpcInit
*
pRpc
);
void
rpcClose
(
void
*
);
void
rpcCloseImpl
(
void
*
);
void
*
rpcMallocCont
(
int
32
_t
contLen
);
void
*
rpcMallocCont
(
int
64
_t
contLen
);
void
rpcFreeCont
(
void
*
pCont
);
void
*
rpcReallocCont
(
void
*
ptr
,
int
32
_t
contLen
);
void
*
rpcReallocCont
(
void
*
ptr
,
int
64
_t
contLen
);
// Because taosd supports multi-process mode
// These functions should not be used on the server side
...
...
include/os/osMemory.h
浏览文件 @
f80dbfb6
...
...
@@ -29,12 +29,12 @@ extern "C" {
#define free FREE_FUNC_TAOS_FORBID
#endif
void
*
taosMemoryMalloc
(
int
32
_t
size
);
void
*
taosMemoryCalloc
(
int
32_t
num
,
int32
_t
size
);
void
*
taosMemoryRealloc
(
void
*
ptr
,
int
32
_t
size
);
void
*
taosMemoryMalloc
(
int
64
_t
size
);
void
*
taosMemoryCalloc
(
int
64_t
num
,
int64
_t
size
);
void
*
taosMemoryRealloc
(
void
*
ptr
,
int
64
_t
size
);
void
*
taosMemoryStrDup
(
const
char
*
ptr
);
void
taosMemoryFree
(
void
*
ptr
);
int
32
_t
taosMemorySize
(
void
*
ptr
);
int
64
_t
taosMemorySize
(
void
*
ptr
);
void
taosPrintBackTrace
();
#define taosMemoryFreeClear(ptr) \
...
...
source/libs/catalog/src/ctgRemote.c
浏览文件 @
f80dbfb6
...
...
@@ -638,7 +638,7 @@ int32_t ctgGetQnodeListFromMnode(SCatalog* pCtg, SRequestConnInfo* pConn, SArray
char
*
msg
=
NULL
;
int32_t
msgLen
=
0
;
int32_t
reqType
=
TDMT_MND_QNODE_LIST
;
void
*
(
*
mallocFp
)(
int
32
_t
)
=
pTask
?
taosMemoryMalloc
:
rpcMallocCont
;
void
*
(
*
mallocFp
)(
int
64
_t
)
=
pTask
?
taosMemoryMalloc
:
rpcMallocCont
;
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
;
int32_t
msgLen
=
0
;
int32_t
reqType
=
TDMT_MND_DNODE_LIST
;
void
*
(
*
mallocFp
)(
int
32
_t
)
=
pTask
?
taosMemoryMalloc
:
rpcMallocCont
;
void
*
(
*
mallocFp
)(
int
64
_t
)
=
pTask
?
taosMemoryMalloc
:
rpcMallocCont
;
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
reqType
=
TDMT_MND_USE_DB
;
SCtgTask
*
pTask
=
tReq
?
tReq
->
pTask
:
NULL
;
void
*
(
*
mallocFp
)(
int
32
_t
)
=
pTask
?
taosMemoryMalloc
:
rpcMallocCont
;
void
*
(
*
mallocFp
)(
int
64
_t
)
=
pTask
?
taosMemoryMalloc
:
rpcMallocCont
;
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
;
int32_t
msgLen
=
0
;
int32_t
reqType
=
TDMT_MND_GET_DB_CFG
;
void
*
(
*
mallocFp
)(
int
32
_t
)
=
pTask
?
taosMemoryMalloc
:
rpcMallocCont
;
void
*
(
*
mallocFp
)(
int
64
_t
)
=
pTask
?
taosMemoryMalloc
:
rpcMallocCont
;
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
;
int32_t
msgLen
=
0
;
int32_t
reqType
=
TDMT_MND_GET_INDEX
;
void
*
(
*
mallocFp
)(
int
32
_t
)
=
pTask
?
taosMemoryMalloc
:
rpcMallocCont
;
void
*
(
*
mallocFp
)(
int
64
_t
)
=
pTask
?
taosMemoryMalloc
:
rpcMallocCont
;
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
;
int32_t
msgLen
=
0
;
int32_t
reqType
=
TDMT_MND_GET_TABLE_INDEX
;
void
*
(
*
mallocFp
)(
int
32
_t
)
=
pTask
?
taosMemoryMalloc
:
rpcMallocCont
;
void
*
(
*
mallocFp
)(
int
64
_t
)
=
pTask
?
taosMemoryMalloc
:
rpcMallocCont
;
char
tbFName
[
TSDB_TABLE_FNAME_LEN
];
tNameExtractFullName
(
name
,
tbFName
);
...
...
@@ -962,7 +962,7 @@ int32_t ctgGetUdfInfoFromMnode(SCatalog* pCtg, SRequestConnInfo* pConn, const ch
char
*
msg
=
NULL
;
int32_t
msgLen
=
0
;
int32_t
reqType
=
TDMT_MND_RETRIEVE_FUNC
;
void
*
(
*
mallocFp
)(
int
32
_t
)
=
pTask
?
taosMemoryMalloc
:
rpcMallocCont
;
void
*
(
*
mallocFp
)(
int
64
_t
)
=
pTask
?
taosMemoryMalloc
:
rpcMallocCont
;
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
;
int32_t
msgLen
=
0
;
int32_t
reqType
=
TDMT_MND_GET_USER_AUTH
;
void
*
(
*
mallocFp
)(
int
32
_t
)
=
pTask
?
taosMemoryMalloc
:
rpcMallocCont
;
void
*
(
*
mallocFp
)(
int
64
_t
)
=
pTask
?
taosMemoryMalloc
:
rpcMallocCont
;
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
;
char
tbFName
[
TSDB_TABLE_FNAME_LEN
];
sprintf
(
tbFName
,
"%s.%s"
,
dbFName
,
tbName
);
void
*
(
*
mallocFp
)(
int
32
_t
)
=
pTask
?
taosMemoryMalloc
:
rpcMallocCont
;
void
*
(
*
mallocFp
)(
int
64
_t
)
=
pTask
?
taosMemoryMalloc
:
rpcMallocCont
;
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
;
char
tbFName
[
TSDB_TABLE_FNAME_LEN
];
sprintf
(
tbFName
,
"%s.%s"
,
dbFName
,
pTableName
->
tname
);
void
*
(
*
mallocFp
)(
int
32
_t
)
=
pTask
?
taosMemoryMalloc
:
rpcMallocCont
;
void
*
(
*
mallocFp
)(
int
64
_t
)
=
pTask
?
taosMemoryMalloc
:
rpcMallocCont
;
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
,
...
...
@@ -1209,7 +1209,7 @@ int32_t ctgGetTableCfgFromVnode(SCatalog* pCtg, SRequestConnInfo* pConn, const S
int32_t
reqType
=
TDMT_VND_TABLE_CFG
;
char
tbFName
[
TSDB_TABLE_FNAME_LEN
];
tNameExtractFullName
(
pTableName
,
tbFName
);
void
*
(
*
mallocFp
)(
int
32
_t
)
=
pTask
?
taosMemoryMalloc
:
rpcMallocCont
;
void
*
(
*
mallocFp
)(
int
64
_t
)
=
pTask
?
taosMemoryMalloc
:
rpcMallocCont
;
char
dbFName
[
TSDB_DB_FNAME_LEN
];
tNameGetFullDbName
(
pTableName
,
dbFName
);
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
;
char
tbFName
[
TSDB_TABLE_FNAME_LEN
];
tNameExtractFullName
(
pTableName
,
tbFName
);
void
*
(
*
mallocFp
)(
int
32
_t
)
=
pTask
?
taosMemoryMalloc
:
rpcMallocCont
;
void
*
(
*
mallocFp
)(
int
64
_t
)
=
pTask
?
taosMemoryMalloc
:
rpcMallocCont
;
char
dbFName
[
TSDB_DB_FNAME_LEN
];
tNameGetFullDbName
(
pTableName
,
dbFName
);
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
;
int32_t
msgLen
=
0
;
int32_t
reqType
=
TDMT_MND_SERVER_VERSION
;
void
*
(
*
mallocFp
)(
int
32
_t
)
=
pTask
?
taosMemoryMalloc
:
rpcMallocCont
;
void
*
(
*
mallocFp
)(
int
64
_t
)
=
pTask
?
taosMemoryMalloc
:
rpcMallocCont
;
qDebug
(
"try to get svr ver from mnode"
);
...
...
source/libs/qcom/src/querymsg.c
浏览文件 @
f80dbfb6
...
...
@@ -24,8 +24,8 @@
#pragma GCC diagnostic ignored "-Wformat-truncation"
#endif
int32_t
(
*
queryBuildMsg
[
TDMT_MAX
])(
void
*
input
,
char
**
msg
,
int32_t
msgSize
,
int32_t
*
msgLen
,
void
*
(
*
mallocFp
)(
int
32
_t
))
=
{
0
};
int32_t
(
*
queryBuildMsg
[
TDMT_MAX
])(
void
*
input
,
char
**
msg
,
int32_t
msgSize
,
int32_t
*
msgLen
,
void
*
(
*
mallocFp
)(
int
64
_t
))
=
{
0
};
int32_t
(
*
queryProcessMsgRsp
[
TDMT_MAX
])(
void
*
output
,
char
*
msg
,
int32_t
msgSize
)
=
{
0
};
int32_t
queryBuildUseDbOutput
(
SUseDbOutput
*
pOut
,
SUseDbRsp
*
usedbRsp
)
{
...
...
@@ -67,8 +67,8 @@ int32_t queryBuildUseDbOutput(SUseDbOutput *pOut, SUseDbRsp *usedbRsp) {
return
TSDB_CODE_SUCCESS
;
}
int32_t
queryBuildTableMetaReqMsg
(
void
*
input
,
char
**
msg
,
int32_t
msgSize
,
int32_t
*
msgLen
,
void
*
(
*
mallcFp
)(
int
32
_t
))
{
int32_t
queryBuildTableMetaReqMsg
(
void
*
input
,
char
**
msg
,
int32_t
msgSize
,
int32_t
*
msgLen
,
void
*
(
*
mallcFp
)(
int
64
_t
))
{
SBuildTableInput
*
pInput
=
input
;
if
(
NULL
==
input
||
NULL
==
msg
||
NULL
==
msgLen
)
{
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
;
}
int32_t
queryBuildUseDbMsg
(
void
*
input
,
char
**
msg
,
int32_t
msgSize
,
int32_t
*
msgLen
,
void
*
(
*
mallcFp
)(
int
32
_t
))
{
int32_t
queryBuildUseDbMsg
(
void
*
input
,
char
**
msg
,
int32_t
msgSize
,
int32_t
*
msgLen
,
void
*
(
*
mallcFp
)(
int
64
_t
))
{
SBuildUseDBInput
*
pInput
=
input
;
if
(
NULL
==
pInput
||
NULL
==
msg
||
NULL
==
msgLen
)
{
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
;
}
int32_t
queryBuildQnodeListMsg
(
void
*
input
,
char
**
msg
,
int32_t
msgSize
,
int32_t
*
msgLen
,
void
*
(
*
mallcFp
)(
int
32
_t
))
{
int32_t
queryBuildQnodeListMsg
(
void
*
input
,
char
**
msg
,
int32_t
msgSize
,
int32_t
*
msgLen
,
void
*
(
*
mallcFp
)(
int
64
_t
))
{
if
(
NULL
==
msg
||
NULL
==
msgLen
)
{
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
;
}
int32_t
queryBuildDnodeListMsg
(
void
*
input
,
char
**
msg
,
int32_t
msgSize
,
int32_t
*
msgLen
,
void
*
(
*
mallcFp
)(
int
32
_t
))
{
int32_t
queryBuildDnodeListMsg
(
void
*
input
,
char
**
msg
,
int32_t
msgSize
,
int32_t
*
msgLen
,
void
*
(
*
mallcFp
)(
int
64
_t
))
{
if
(
NULL
==
msg
||
NULL
==
msgLen
)
{
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
;
}
int32_t
queryBuildGetSerVerMsg
(
void
*
input
,
char
**
msg
,
int32_t
msgSize
,
int32_t
*
msgLen
,
void
*
(
*
mallcFp
)(
int
32
_t
))
{
int32_t
queryBuildGetSerVerMsg
(
void
*
input
,
char
**
msg
,
int32_t
msgSize
,
int32_t
*
msgLen
,
void
*
(
*
mallcFp
)(
int
64
_t
))
{
if
(
NULL
==
msg
||
NULL
==
msgLen
)
{
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
;
}
int32_t
queryBuildGetDBCfgMsg
(
void
*
input
,
char
**
msg
,
int32_t
msgSize
,
int32_t
*
msgLen
,
void
*
(
*
mallcFp
)(
int
32
_t
))
{
int32_t
queryBuildGetDBCfgMsg
(
void
*
input
,
char
**
msg
,
int32_t
msgSize
,
int32_t
*
msgLen
,
void
*
(
*
mallcFp
)(
int
64
_t
))
{
if
(
NULL
==
msg
||
NULL
==
msgLen
)
{
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
;
}
int32_t
queryBuildGetIndexMsg
(
void
*
input
,
char
**
msg
,
int32_t
msgSize
,
int32_t
*
msgLen
,
void
*
(
*
mallcFp
)(
int
32
_t
))
{
int32_t
queryBuildGetIndexMsg
(
void
*
input
,
char
**
msg
,
int32_t
msgSize
,
int32_t
*
msgLen
,
void
*
(
*
mallcFp
)(
int
64
_t
))
{
if
(
NULL
==
msg
||
NULL
==
msgLen
)
{
return
TSDB_CODE_TSC_INVALID_INPUT
;
}
...
...
@@ -203,8 +203,8 @@ int32_t queryBuildGetIndexMsg(void *input, char **msg, int32_t msgSize, int32_t
return
TSDB_CODE_SUCCESS
;
}
int32_t
queryBuildRetrieveFuncMsg
(
void
*
input
,
char
**
msg
,
int32_t
msgSize
,
int32_t
*
msgLen
,
void
*
(
*
mallcFp
)(
int
32
_t
))
{
int32_t
queryBuildRetrieveFuncMsg
(
void
*
input
,
char
**
msg
,
int32_t
msgSize
,
int32_t
*
msgLen
,
void
*
(
*
mallcFp
)(
int
64
_t
))
{
if
(
NULL
==
msg
||
NULL
==
msgLen
)
{
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
;
}
int32_t
queryBuildGetUserAuthMsg
(
void
*
input
,
char
**
msg
,
int32_t
msgSize
,
int32_t
*
msgLen
,
void
*
(
*
mallcFp
)(
int
32
_t
))
{
int32_t
queryBuildGetUserAuthMsg
(
void
*
input
,
char
**
msg
,
int32_t
msgSize
,
int32_t
*
msgLen
,
void
*
(
*
mallcFp
)(
int
64
_t
))
{
if
(
NULL
==
msg
||
NULL
==
msgLen
)
{
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
;
}
int32_t
queryBuildGetTbIndexMsg
(
void
*
input
,
char
**
msg
,
int32_t
msgSize
,
int32_t
*
msgLen
,
void
*
(
*
mallcFp
)(
int
32
_t
))
{
int32_t
queryBuildGetTbIndexMsg
(
void
*
input
,
char
**
msg
,
int32_t
msgSize
,
int32_t
*
msgLen
,
void
*
(
*
mallcFp
)(
int
64
_t
))
{
if
(
NULL
==
msg
||
NULL
==
msgLen
)
{
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
;
}
int32_t
queryBuildGetTbCfgMsg
(
void
*
input
,
char
**
msg
,
int32_t
msgSize
,
int32_t
*
msgLen
,
void
*
(
*
mallcFp
)(
int
32
_t
))
{
int32_t
queryBuildGetTbCfgMsg
(
void
*
input
,
char
**
msg
,
int32_t
msgSize
,
int32_t
*
msgLen
,
void
*
(
*
mallcFp
)(
int
64
_t
))
{
if
(
NULL
==
msg
||
NULL
==
msgLen
)
{
return
TSDB_CODE_TSC_INVALID_INPUT
;
}
...
...
source/libs/transport/src/trans.c
浏览文件 @
f80dbfb6
...
...
@@ -100,8 +100,8 @@ void rpcCloseImpl(void* arg) {
taosMemoryFree
(
pRpc
);
}
void
*
rpcMallocCont
(
int
32
_t
contLen
)
{
int
32
_t
size
=
contLen
+
TRANS_MSG_OVERHEAD
;
void
*
rpcMallocCont
(
int
64
_t
contLen
)
{
int
64
_t
size
=
contLen
+
TRANS_MSG_OVERHEAD
;
char
*
start
=
taosMemoryCalloc
(
1
,
size
);
if
(
start
==
NULL
)
{
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
);
}
void
*
rpcReallocCont
(
void
*
ptr
,
int
32
_t
contLen
)
{
void
*
rpcReallocCont
(
void
*
ptr
,
int
64
_t
contLen
)
{
if
(
ptr
==
NULL
)
return
rpcMallocCont
(
contLen
);
char
*
st
=
(
char
*
)
ptr
-
TRANS_MSG_OVERHEAD
;
int
32
_t
sz
=
contLen
+
TRANS_MSG_OVERHEAD
;
int
64
_t
sz
=
contLen
+
TRANS_MSG_OVERHEAD
;
st
=
taosMemoryRealloc
(
st
,
sz
);
if
(
st
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
...
...
source/os/src/osMemory.c
浏览文件 @
f80dbfb6
...
...
@@ -228,7 +228,7 @@ void taosPrintBackTrace() {
void
taosPrintBackTrace
()
{
return
;
}
#endif
void
*
taosMemoryMalloc
(
int
32
_t
size
)
{
void
*
taosMemoryMalloc
(
int
64
_t
size
)
{
#ifdef USE_TD_MEMORY
void
*
tmp
=
malloc
(
size
+
sizeof
(
TdMemoryInfo
));
if
(
tmp
==
NULL
)
return
NULL
;
...
...
@@ -244,7 +244,7 @@ void *taosMemoryMalloc(int32_t size) {
#endif
}
void
*
taosMemoryCalloc
(
int
32_t
num
,
int32
_t
size
)
{
void
*
taosMemoryCalloc
(
int
64_t
num
,
int64
_t
size
)
{
#ifdef USE_TD_MEMORY
int32_t
memorySize
=
num
*
size
;
char
*
tmp
=
calloc
(
memorySize
+
sizeof
(
TdMemoryInfo
),
1
);
...
...
@@ -261,7 +261,7 @@ void *taosMemoryCalloc(int32_t num, int32_t size) {
#endif
}
void
*
taosMemoryRealloc
(
void
*
ptr
,
int
32
_t
size
)
{
void
*
taosMemoryRealloc
(
void
*
ptr
,
int
64
_t
size
)
{
#ifdef USE_TD_MEMORY
if
(
ptr
==
NULL
)
return
taosMemoryMalloc
(
size
);
...
...
@@ -318,7 +318,7 @@ void taosMemoryFree(void *ptr) {
#endif
}
int
32
_t
taosMemorySize
(
void
*
ptr
)
{
int
64
_t
taosMemorySize
(
void
*
ptr
)
{
if
(
ptr
==
NULL
)
return
0
;
#ifdef USE_TD_MEMORY
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录