summaryrefslogtreecommitdiff
path: root/liboffloadmic
diff options
context:
space:
mode:
authoriverbin <iverbin@138bc75d-0d04-0410-961f-82ee72b054a4>2015-10-26 14:38:02 +0000
committeriverbin <iverbin@138bc75d-0d04-0410-961f-82ee72b054a4>2015-10-26 14:38:02 +0000
commit5841bee23596e743c8eb8d37c0abb8caa052546e (patch)
tree13c66ea2a6047f853a3a1325b9ed79848c78df4a /liboffloadmic
parent17e1096936d2c1d4a8589744cfa76e91f44be194 (diff)
downloadgcc-5841bee23596e743c8eb8d37c0abb8caa052546e.tar.gz
liboffloadmic/
* runtime/offload_host.cpp (OffloadDescriptor::setup_misc_data): Use calloc instead of malloc. (__offload_fini_library): Set mic_engines_total to zero. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229368 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'liboffloadmic')
-rw-r--r--liboffloadmic/ChangeLog7
-rw-r--r--liboffloadmic/runtime/offload_host.cpp5
2 files changed, 10 insertions, 2 deletions
diff --git a/liboffloadmic/ChangeLog b/liboffloadmic/ChangeLog
index 82e7999188c..93419bdfaaf 100644
--- a/liboffloadmic/ChangeLog
+++ b/liboffloadmic/ChangeLog
@@ -1,3 +1,10 @@
+2015-10-26 Ilya Verbin <ilya.verbin@intel.com>
+ Aleksander Ivanushenko <aleksander.ivanushenko@intel.com>
+
+ * runtime/offload_host.cpp (OffloadDescriptor::setup_misc_data): Use
+ calloc instead of malloc.
+ (__offload_fini_library): Set mic_engines_total to zero.
+
2015-10-13 Ilya Verbin <ilya.verbin@intel.com>
* plugin/libgomp-plugin-intelmic.cpp (GOMP_OFFLOAD_dev2dev): New
diff --git a/liboffloadmic/runtime/offload_host.cpp b/liboffloadmic/runtime/offload_host.cpp
index eec457d386a..c10dc4efb55 100644
--- a/liboffloadmic/runtime/offload_host.cpp
+++ b/liboffloadmic/runtime/offload_host.cpp
@@ -2421,8 +2421,8 @@ bool OffloadDescriptor::setup_misc_data(const char *name)
}
// initialize function descriptor
- m_func_desc = (FunctionDescriptor*) malloc(m_func_desc_size +
- misc_data_size);
+ m_func_desc = (FunctionDescriptor*) calloc(1, m_func_desc_size
+ + misc_data_size);
if (m_func_desc == NULL)
LIBOFFLOAD_ERROR(c_malloc);
m_func_desc->console_enabled = console_enabled;
@@ -5087,6 +5087,7 @@ static void __offload_fini_library(void)
OFFLOAD_DEBUG_TRACE(2, "Cleanup offload library ...\n");
if (mic_engines_total > 0) {
delete[] mic_engines;
+ mic_engines_total = 0;
if (mic_proxy_fs_root != 0) {
free(mic_proxy_fs_root);