summaryrefslogtreecommitdiffstats
path: root/openmp
diff options
context:
space:
mode:
authorAndrey Churbanov <Andrey.Churbanov@intel.com>2016-07-08 14:53:24 +0000
committerAndrey Churbanov <Andrey.Churbanov@intel.com>2016-07-08 14:53:24 +0000
commit2eca95c9a985ae36f6d00b311ddf7fcab513041b (patch)
tree4c1cc053db6d45e1c2b808567dec862f64d2f0ef /openmp
parentcb28d6e3a0830deeed42187899e775009981af4c (diff)
downloadbcm5719-llvm-2eca95c9a985ae36f6d00b311ddf7fcab513041b.tar.gz
bcm5719-llvm-2eca95c9a985ae36f6d00b311ddf7fcab513041b.zip
D22137: Memory leak fixed by adding missed cleanup of single level array of hot teams info
llvm-svn: 274851
Diffstat (limited to 'openmp')
-rw-r--r--openmp/runtime/src/kmp_runtime.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/openmp/runtime/src/kmp_runtime.c b/openmp/runtime/src/kmp_runtime.c
index b46a8b2afaa..180c5339c28 100644
--- a/openmp/runtime/src/kmp_runtime.c
+++ b/openmp/runtime/src/kmp_runtime.c
@@ -3822,10 +3822,12 @@ __kmp_reset_root(int gtid, kmp_root_t *root)
// to __kmp_free_team().
__kmp_free_team( root, root_team USE_NESTED_HOT_ARG(NULL) );
#if KMP_NESTED_HOT_TEAMS
- if( __kmp_hot_teams_max_level > 1 ) { // need to free nested hot teams and their threads if any
+ if( __kmp_hot_teams_max_level > 0 ) { // need to free nested hot teams and their threads if any
for( i = 0; i < hot_team->t.t_nproc; ++i ) {
kmp_info_t *th = hot_team->t.t_threads[i];
- n += __kmp_free_hot_teams( root, th, 1, __kmp_hot_teams_max_level );
+ if( __kmp_hot_teams_max_level > 1 ) {
+ n += __kmp_free_hot_teams( root, th, 1, __kmp_hot_teams_max_level );
+ }
if( th->th.th_hot_teams ) {
__kmp_free( th->th.th_hot_teams );
th->th.th_hot_teams = NULL;
OpenPOWER on IntegriCloud