diff options
author | Ilya Verbin <ilya.verbin@intel.com> | 2015-10-26 14:38:02 +0000 |
---|---|---|
committer | Ilya Verbin <iverbin@gcc.gnu.org> | 2015-10-26 14:38:02 +0000 |
commit | 0b7c37ee712fdc5164db6cd6acb816fcf6752c02 (patch) | |
tree | 13c66ea2a6047f853a3a1325b9ed79848c78df4a /liboffloadmic/runtime | |
parent | 6a112b50ef2741a635b9235ca68890033b17322f (diff) | |
download | gcc-0b7c37ee712fdc5164db6cd6acb816fcf6752c02.zip gcc-0b7c37ee712fdc5164db6cd6acb816fcf6752c02.tar.gz gcc-0b7c37ee712fdc5164db6cd6acb816fcf6752c02.tar.bz2 |
offload_host.cpp (OffloadDescriptor::setup_misc_data): Use calloc instead of malloc.
liboffloadmic/
* runtime/offload_host.cpp (OffloadDescriptor::setup_misc_data): Use
calloc instead of malloc.
(__offload_fini_library): Set mic_engines_total to zero.
Co-Authored-By: Aleksander Ivanushenko <aleksander.ivanushenko@intel.com>
From-SVN: r229368
Diffstat (limited to 'liboffloadmic/runtime')
-rw-r--r-- | liboffloadmic/runtime/offload_host.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/liboffloadmic/runtime/offload_host.cpp b/liboffloadmic/runtime/offload_host.cpp index eec457d..c10dc4e 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); |