Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use xbt_malloc (and friends) instead of direct malloc()
[simgrid.git] / src / instr / instr_routing.c
index e432217..0b4b84d 100644 (file)
@@ -5,6 +5,7 @@
   * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "instr/instr_private.h"
+#include "mc/mc.h"
 
 #ifdef HAVE_TRACING
 #include "surf/surf_private.h"
@@ -117,6 +118,10 @@ static void linkContainers (container_t src, container_t dst, xbt_dict_t filter)
 
   //create the link
   static long long counter = 0;
+
+  if(MC_is_active())
+    MC_ignore_data_bss(&counter, sizeof(counter));
+
   char key[INSTR_DEFAULT_STR_SIZE];
   snprintf (key, INSTR_DEFAULT_STR_SIZE, "%lld", counter++);
   new_pajeStartLink(SIMIX_get_clock(), father, link_type, src, "topology", key);
@@ -484,7 +489,7 @@ static xbt_edge_t new_xbt_graph_edge (xbt_graph_t graph, xbt_node_t s, xbt_node_
   const char *sn = instr_node_name (s);
   const char *dn = instr_node_name (d);
   int len = strlen(sn)+strlen(dn)+1;
-  char *name = (char*)malloc(len * sizeof(char));
+  char *name = (char*)xbt_malloc(len * sizeof(char));
 
 
   snprintf (name, len, "%s%s", sn, dn);