Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Avoid useless zero-initialisations in the hot spot
authorGabriel Corona <gabriel.corona@loria.fr>
Tue, 4 Feb 2014 13:33:57 +0000 (14:33 +0100)
committerGabriel Corona <gabriel.corona@loria.fr>
Fri, 7 Feb 2014 08:20:52 +0000 (09:20 +0100)
src/mc/mc_checkpoint.c

index 2750396..9b11f18 100644 (file)
@@ -9,6 +9,7 @@
 #include <link.h>
 #include "mc_private.h"
 #include "xbt/module.h"
+#include <xbt/mmalloc.h>
 
 #include "../simix/smx_private.h"
 
@@ -72,10 +73,10 @@ void MC_free_snapshot(mc_snapshot_t snapshot){
 
 static mc_mem_region_t MC_region_new(int type, void *start_addr, size_t size)
 {
-  mc_mem_region_t new_reg = xbt_new0(s_mc_mem_region_t, 1);
+  mc_mem_region_t new_reg = xbt_new(s_mc_mem_region_t, 1);
   new_reg->start_addr = start_addr;
   new_reg->size = size;
-  new_reg->data = xbt_malloc0(size);
+  new_reg->data = xbt_malloc(size);
   memcpy(new_reg->data, start_addr, size);
 
   XBT_DEBUG("New region : type : %d, data : %p (real addr %p), size : %zu", type, new_reg->data, start_addr, size);