X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/91253bbf28bd453788ae52d3a14b617234e533e2..9740a26f7f05adb6289f0db8c01007ee1394fb5e:/include/smpi/smpi_cocci.h diff --git a/include/smpi/smpi_cocci.h b/include/smpi/smpi_cocci.h index 8243e7ac3e..c4ea46fdbf 100644 --- a/include/smpi/smpi_cocci.h +++ b/include/smpi/smpi_cocci.h @@ -15,7 +15,7 @@ type *name = NULL; \ static void __attribute__((constructor)) __preinit_##name(void) { \ if(!name) \ - name = (type*)malloc(smpi_global_size() * sizeof(type)); \ + name = (type*)calloc(smpi_global_size(), sizeof(type)); \ } \ static void __attribute__((destructor)) __postfini_##name(void) { \ free(name); \ @@ -55,7 +55,7 @@ XBT_PUBLIC(void) smpi_free_static(void); #define SMPI_VARINIT_STATIC(name,type) \ static type *name = NULL; \ if(!name) { \ - name = (type*)malloc(smpi_global_size() * sizeof(type)); \ + name = (type*)calloc(smpi_global_size(), sizeof(type)); \ smpi_register_static(name, xbt_free); \ }