Committed to OG9 on behalf of Kwok ...
The list of struct gomp_threads allocated in gomp_gcn_enter_kernel was
not being freed in gomp_gcn_exit_kernel, leading to a small memory leak
every time a kernel is run. Runs with a lot of teams or many kernels
were running out of heap space.
Andrew
Fix memory leak in libgomp when using OpenMP
2019-09-10 Kwok Cheung Yeung <k...@codesourcery.com>
libgomp/
* config/gcn/team.c (gomp_gcn_exit_kernel): Free GCN thread list.
diff --git a/libgomp/config/gcn/team.c b/libgomp/config/gcn/team.c
index 79aec65a24e..534cf595c98 100644
--- a/libgomp/config/gcn/team.c
+++ b/libgomp/config/gcn/team.c
@@ -93,6 +93,7 @@ void
gomp_gcn_exit_kernel (void)
{
gomp_free_thread (gcn_thrs ());
+ free (gcn_thrs ());
}
/* This function contains the idle loop in which a thread waits