Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
bf3abcc0
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
bf3abcc0
编写于
2月 29, 2020
作者:
H
hjxilinx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix memory leaks.
上级
47477417
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
21 addition
and
20 deletion
+21
-20
src/system/detail/inc/vnodeQueryImpl.h
src/system/detail/inc/vnodeQueryImpl.h
+2
-2
src/system/detail/src/vnodeQueryImpl.c
src/system/detail/src/vnodeQueryImpl.c
+19
-18
未找到文件。
src/system/detail/inc/vnodeQueryImpl.h
浏览文件 @
bf3abcc0
...
...
@@ -277,9 +277,9 @@ void copyTimeWindowResBuf(SQueryRuntimeEnv* pRuntimeEnv, SWindowResult* dst, con
int32_t
initWindowResInfo
(
SWindowResInfo
*
pWindowResInfo
,
SQueryRuntimeEnv
*
pRuntimeEnv
,
int32_t
size
,
int32_t
threshold
,
int16_t
type
);
void
cleanupTimeWindowInfo
(
SWindowResInfo
*
pWindowResInfo
,
SQueryRuntimeEnv
*
pRuntimeEnv
);
void
cleanupTimeWindowInfo
(
SWindowResInfo
*
pWindowResInfo
,
int32_t
numOfCols
);
void
resetTimeWindowInfo
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
SWindowResInfo
*
pWindowResInfo
);
void
clearFirstNTimeWindow
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
int32_t
num
);
void
clearFirstNTimeWindow
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
int32_t
num
);
void
clearClosedTimeWindow
(
SQueryRuntimeEnv
*
pRuntimeEnv
);
int32_t
numOfClosedTimeWindow
(
SWindowResInfo
*
pWindowResInfo
);
...
...
src/system/detail/src/vnodeQueryImpl.c
浏览文件 @
bf3abcc0
...
...
@@ -1740,7 +1740,8 @@ static void doBlockwiseApplyFunctions(SQueryRuntimeEnv *pRuntimeEnv, SWindowStat
pCtx
[
k
].
nStartQueryTimestamp
=
pWin
->
skey
;
pCtx
[
k
].
size
=
forwardStep
;
pCtx
[
k
].
startOffset
=
(
QUERY_IS_ASC_QUERY
(
pQuery
))
?
startPos
:
startPos
-
(
forwardStep
-
1
);
pCtx
[
k
].
ptsList
=
(
TSKEY
*
)((
char
*
)
pRuntimeEnv
->
primaryColBuffer
->
data
+
pCtx
[
k
].
startOffset
*
TSDB_KEYSIZE
);
int32_t
functionId
=
pQuery
->
pSelectExpr
[
k
].
pBase
.
functionId
;
if
(
functionNeedToExecute
(
pRuntimeEnv
,
&
pCtx
[
k
],
functionId
))
{
aAggs
[
functionId
].
xFunction
(
&
pCtx
[
k
]);
...
...
@@ -2041,7 +2042,7 @@ int32_t initWindowResInfo(SWindowResInfo *pWindowResInfo, SQueryRuntimeEnv *pRun
return
TSDB_CODE_SUCCESS
;
}
void
cleanupTimeWindowInfo
(
SWindowResInfo
*
pWindowResInfo
,
SQueryRuntimeEnv
*
pRuntimeEnv
)
{
void
cleanupTimeWindowInfo
(
SWindowResInfo
*
pWindowResInfo
,
int32_t
numOfCols
)
{
if
(
pWindowResInfo
==
NULL
||
pWindowResInfo
->
capacity
==
0
)
{
assert
(
pWindowResInfo
->
hashList
==
NULL
&&
pWindowResInfo
->
pResult
==
NULL
);
return
;
...
...
@@ -2049,7 +2050,7 @@ void cleanupTimeWindowInfo(SWindowResInfo *pWindowResInfo, SQueryRuntimeEnv *pRu
for
(
int32_t
i
=
0
;
i
<
pWindowResInfo
->
capacity
;
++
i
)
{
SWindowResult
*
pResult
=
&
pWindowResInfo
->
pResult
[
i
];
destroyTimeWindowRes
(
pResult
,
pRuntimeEnv
->
pQuery
->
numOfOutput
Cols
);
destroyTimeWindowRes
(
pResult
,
numOf
Cols
);
}
taosCleanUpHashTable
(
pWindowResInfo
->
hashList
);
...
...
@@ -2854,16 +2855,18 @@ static void teardownQueryRuntimeEnv(SQueryRuntimeEnv *pRuntimeEnv) {
return
;
}
dTrace
(
"QInfo:%p teardown runtime env"
,
GET_QINFO_ADDR
(
pRuntimeEnv
->
pQuery
));
for
(
int32_t
i
=
0
;
i
<
pRuntimeEnv
->
pQuery
->
numOfCols
;
++
i
)
{
SQuery
*
pQuery
=
pRuntimeEnv
->
pQuery
;
dTrace
(
"QInfo:%p teardown runtime env"
,
GET_QINFO_ADDR
(
pQuery
));
for
(
int32_t
i
=
0
;
i
<
pQuery
->
numOfCols
;
++
i
)
{
tfree
(
pRuntimeEnv
->
colDataBuffer
[
i
]);
}
tfree
(
pRuntimeEnv
->
secondaryUnzipBuffer
);
cleanupTimeWindowInfo
(
&
pRuntimeEnv
->
windowResInfo
,
p
RuntimeEnv
);
cleanupTimeWindowInfo
(
&
pRuntimeEnv
->
windowResInfo
,
p
Query
->
numOfOutputCols
);
if
(
pRuntimeEnv
->
pCtx
!=
NULL
)
{
for
(
int32_t
i
=
0
;
i
<
p
RuntimeEnv
->
p
Query
->
numOfOutputCols
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
pQuery
->
numOfOutputCols
;
++
i
)
{
SQLFunctionCtx
*
pCtx
=
&
pRuntimeEnv
->
pCtx
[
i
];
for
(
int32_t
j
=
0
;
j
<
pCtx
->
numOfParams
;
++
j
)
{
...
...
@@ -2881,7 +2884,7 @@ static void teardownQueryRuntimeEnv(SQueryRuntimeEnv *pRuntimeEnv) {
tfree
(
pRuntimeEnv
->
unzipBuffer
);
if
(
p
RuntimeEnv
->
pQuery
&&
(
!
PRIMARY_TSCOL_LOADED
(
pRuntimeEnv
->
pQuery
)))
{
if
(
p
Query
&&
(
!
PRIMARY_TSCOL_LOADED
(
pQuery
)))
{
tfree
(
pRuntimeEnv
->
primaryColBuffer
);
}
...
...
@@ -2895,7 +2898,7 @@ static void teardownQueryRuntimeEnv(SQueryRuntimeEnv *pRuntimeEnv) {
taosDestoryInterpoInfo
(
&
pRuntimeEnv
->
interpoInfo
);
if
(
pRuntimeEnv
->
pInterpoBuf
!=
NULL
)
{
for
(
int32_t
i
=
0
;
i
<
p
RuntimeEnv
->
p
Query
->
numOfOutputCols
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
pQuery
->
numOfOutputCols
;
++
i
)
{
tfree
(
pRuntimeEnv
->
pInterpoBuf
[
i
]);
}
...
...
@@ -5869,10 +5872,13 @@ int32_t doMergeMetersResultsToGroupRes(STableQuerySupportObj *pSupporter, SQuery
tfree
(
pTree
);
tfree
(
pTableList
);
tfree
(
posList
);
tfree
(
pResultInfo
);
pSupporter
->
offset
=
0
;
for
(
int32_t
i
=
0
;
i
<
pQuery
->
numOfOutputCols
;
++
i
)
{
tfree
(
pResultInfo
[
i
].
interResultBuf
);
}
tfree
(
pResultInfo
);
return
pSupporter
->
numOfGroupResultPages
;
}
...
...
@@ -6626,13 +6632,8 @@ void destroyMeterQueryInfo(SMeterQueryInfo *pMeterQueryInfo, int32_t numOfCols)
if
(
pMeterQueryInfo
==
NULL
)
{
return
;
}
// free(pMeterQueryInfo->pageList);
// for (int32_t i = 0; i < numOfCols; ++i) {
// tfree(pMeterQueryInfo->[i].interResultBuf);
// }
// free(pMeterQueryInfo->resultInfo);
cleanupTimeWindowInfo
(
&
pMeterQueryInfo
->
windowResInfo
,
numOfCols
);
free
(
pMeterQueryInfo
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录