[Openmp-commits] [openmp] r274851 - D22137: Memory leak fixed by adding missed cleanup of single level array of hot teams info

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


Author: achurbanov
Date: Fri Jul  8 09:53:24 2016
New Revision: 274851

URL: http://llvm.org/viewvc/llvm-project?rev=274851&view=rev
Log:
D22137: Memory leak fixed by adding missed cleanup of single level array of hot teams info

Modified:
    openmp/trunk/runtime/src/kmp_runtime.c

Modified: openmp/trunk/runtime/src/kmp_runtime.c
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_runtime.c?rev=274851&r1=274850&r2=274851&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_runtime.c (original)
+++ openmp/trunk/runtime/src/kmp_runtime.c Fri Jul  8 09:53:24 2016
@@ -3822,10 +3822,12 @@ __kmp_reset_root(int gtid, kmp_root_t *r
         // 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;




More information about the Openmp-commits mailing list