[Openmp-commits] [PATCH] D22137: Another memory leak fixed.

Andrey Churbanov via Openmp-commits openmp-commits at lists.llvm.org
Fri Jul 8 07:37:51 PDT 2016


AndreyChurbanov created this revision.
AndreyChurbanov added reviewers: tlwilmar, jlpeyton, hbae.
AndreyChurbanov added a subscriber: openmp-commits.
AndreyChurbanov set the repository for this revision to rL LLVM.

Added missed cleanup of the top level array of hot team info.

Repository:
  rL LLVM

http://reviews.llvm.org/D22137

Files:
  runtime/src/kmp_runtime.c

Index: runtime/src/kmp_runtime.c
===================================================================
--- runtime/src/kmp_runtime.c
+++ runtime/src/kmp_runtime.c
@@ -3822,10 +3822,12 @@
         // 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;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22137.63220.patch
Type: text/x-patch
Size: 997 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20160708/e14c44af/attachment.bin>


More information about the Openmp-commits mailing list