Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
function check_fraghead to detect mmalloc metadata corruption
[simgrid.git] / src / xbt / mmalloc / mm_module.c
index 1272d4d..87bbb8a 100644 (file)
@@ -339,3 +339,22 @@ void mmalloc_postexit(void)
   //  mmalloc_detach(__mmalloc_default_mdp);
   xbt_mheap_destroy_no_free(__mmalloc_default_mdp);
 }
+
+void check_fraghead(struct mdesc *mdp){
+
+  struct list* next;
+  int j;
+
+  for (j=8; j<12; j++){
+    next = mdp->fraghead[j].next;
+    if(next != NULL){
+      while(next->next != NULL){
+        if(next->next->prev == NULL);
+        next = next->next;
+      }
+    }
+  }
+
+  fprintf(stderr, "check fraghead ok\n");
+
+}