gcc/libgomp/plugin
Tom de Vries 738c56d410 [nvptx, libgomp] Fix memleak in GOMP_OFFLOAD_fini_device
I wrote a test-case:
...
int
main (void)
{
  for (unsigned i = 0; i < 128; ++i)
    {
      acc_init (acc_device_nvidia);
      acc_shutdown (acc_device_nvidia);
    }

  return 0;
}
...
and ran it under valgrind.  The only leak location reported with a frequency
of 128, was the allocation of ptx_devices in nvptx_init.

Fix this by freeing ptx_devices in GOMP_OFFLOAD_fini_device, once
instantiated_devices drops to 0.

2019-01-24  Tom de Vries  <tdevries@suse.de>

	* plugin/plugin-nvptx.c (GOMP_OFFLOAD_fini_device): Free ptx_devices
	once instantiated_devices drops to 0.

From-SVN: r268237
2019-01-24 14:12:19 +00:00
..
cuda Update copyright years. 2019-01-01 13:31:55 +01:00
Makefrag.am Update copyright years. 2019-01-01 13:31:55 +01:00
configfrag.ac Update copyright years. 2019-01-01 13:31:55 +01:00
cuda-lib.def [nvptx] Use CUDA driver API to select default runtime launch geometry 2018-08-13 12:04:24 +00:00
hsa_ext_finalize.h Update copyright years. 2019-01-01 13:31:55 +01:00
plugin-hsa.c Update copyright years. 2019-01-01 13:31:55 +01:00
plugin-nvptx.c [nvptx, libgomp] Fix memleak in GOMP_OFFLOAD_fini_device 2019-01-24 14:12:19 +00:00