Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Multiple heap removal (partial)
[simgrid.git] / src / mc / mc_process.cpp
index 86ccf94..5dbbddd 100644 (file)
@@ -1,3 +1,9 @@
+/* Copyright (c) 2014-2015. The SimGrid Team.
+ * All rights reserved.                                                     */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
 #include <assert.h>
 #include <stddef.h>
 #include <stdbool.h>
@@ -151,9 +157,7 @@ void MC_process_refresh_heap(mc_process_t process)
   assert(!MC_process_is_self(process));
   // Read/dereference/refresh the std_heap pointer:
   if (!process->heap) {
-    xbt_mheap_t oldheap  = mmalloc_set_current_heap(mc_heap);
     process->heap = (struct mdesc*) malloc(sizeof(struct mdesc));
-    mmalloc_set_current_heap(oldheap);
   }
   MC_process_read(process, MC_ADDRESS_SPACE_READ_FLAGS_NONE,
     process->heap, process->heap_address, sizeof(struct mdesc),
@@ -169,11 +173,7 @@ void MC_process_refresh_malloc_info(mc_process_t process)
   // Refresh process->heapinfo:
   size_t malloc_info_bytesize =
     (process->heap->heaplimit + 1) * sizeof(malloc_info);
-
-  xbt_mheap_t heap  = mmalloc_set_current_heap(mc_heap);
   process->heap_info = (malloc_info*) realloc(process->heap_info, malloc_info_bytesize);
-  mmalloc_set_current_heap(heap);
-
   MC_process_read(process, MC_ADDRESS_SPACE_READ_FLAGS_NONE,
     process->heap_info,
     process->heap->heapinfo, malloc_info_bytesize,