A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[mc] Cleanup heap switching code
[simgrid.git]
/
src
/
mc
/
mc_process.c
diff --git
a/src/mc/mc_process.c
b/src/mc/mc_process.c
index
2ed9f26
..
65c77a8
100644
(file)
--- a/
src/mc/mc_process.c
+++ b/
src/mc/mc_process.c
@@
-141,8
+141,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) {
assert(!MC_process_is_self(process));
// Read/dereference/refresh the std_heap pointer:
if (!process->heap) {
- xbt_mheap_t oldheap = mmalloc_get_current_heap();
- MC_SET_MC_HEAP;
+ xbt_mheap_t oldheap = mmalloc_set_current_heap(mc_heap);
process->heap = malloc(sizeof(struct mdesc));
mmalloc_set_current_heap(oldheap);
}
process->heap = malloc(sizeof(struct mdesc));
mmalloc_set_current_heap(oldheap);
}
@@
-160,11
+159,10
@@
void MC_process_refresh_malloc_info(mc_process_t process)
// Refresh process->heapinfo:
size_t malloc_info_bytesize = process->heap->heaplimit * sizeof(malloc_info);
// Refresh process->heapinfo:
size_t malloc_info_bytesize = process->heap->heaplimit * sizeof(malloc_info);
- xbt_mheap_t oldheap = mmalloc_get_current_heap();
- MC_SET_MC_HEAP;
+ xbt_mheap_t heap = mmalloc_set_current_heap(mc_heap);
process->heap_info = (malloc_info*) realloc(process->heap_info,
malloc_info_bytesize);
process->heap_info = (malloc_info*) realloc(process->heap_info,
malloc_info_bytesize);
- mmalloc_set_current_heap(
old
heap);
+ mmalloc_set_current_heap(heap);
MC_process_read(process, MC_ADDRESS_SPACE_READ_FLAGS_NONE,
process->heap_info,
MC_process_read(process, MC_ADDRESS_SPACE_READ_FLAGS_NONE,
process->heap_info,