X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/22e6546d2c6f14864cc93c4ed1470d8e8c1e2d95..5eeb3c843b60e9ba5e1a952ffe83df2a4d8f5fa0:/src/mc/compare.cpp diff --git a/src/mc/compare.cpp b/src/mc/compare.cpp index 0e3887d570..ef934d6bad 100644 --- a/src/mc/compare.cpp +++ b/src/mc/compare.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2017. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2008-2018. 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. */ @@ -32,11 +32,12 @@ #include "src/mc/ObjectInformation.hpp" #include "src/mc/Type.hpp" #include "src/mc/Variable.hpp" +#include "src/mc/mc_config.hpp" #include "src/mc/mc_dwarf.hpp" #include "src/mc/mc_forward.hpp" #include "src/mc/mc_private.hpp" #include "src/mc/mc_smx.hpp" -#include "src/mc/mc_snapshot.hpp" +#include "src/mc/sosp/mc_snapshot.hpp" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_compare, xbt, "Logging specific to mc_compare in mc"); @@ -122,7 +123,8 @@ namespace { * * It can hash pairs: the standard hash currently doesn't include this. */ -template struct hash : public std::hash {}; +template class hash : public std::hash { +}; template class hash> { public: @@ -343,9 +345,9 @@ int mmalloc_compare_heap( // This is in snapshot do not use them directly: const malloc_info* heapinfos1 = snapshot1->read( - (std::uint64_t)heapinfo_address, simgrid::mc::ProcessIndexMissing); + RemotePtr((std::uint64_t)heapinfo_address), simgrid::mc::ProcessIndexMissing); const malloc_info* heapinfos2 = snapshot2->read( - (std::uint64_t)heapinfo_address, simgrid::mc::ProcessIndexMissing); + RemotePtr((std::uint64_t)heapinfo_address), simgrid::mc::ProcessIndexMissing); while (i1 < state.heaplimit) { @@ -1031,14 +1033,12 @@ int compare_heap_area(simgrid::mc::StateComparator& state, int process_index, return 0; } - if (type_size != -1) { - if (type_size != (ssize_t) heapinfo1->busy_block.busy_size - && type_size != (ssize_t) heapinfo2->busy_block.busy_size - && (type->name.empty() || type->name == "struct s_smx_context")) { - if (match_pairs) - state.match_equals(previous); - return -1; - } + if (type_size != -1 && type_size != (ssize_t)heapinfo1->busy_block.busy_size && + type_size != (ssize_t)heapinfo2->busy_block.busy_size && + (type->name.empty() || type->name == "struct s_smx_context")) { + if (match_pairs) + state.match_equals(previous); + return -1; } if (heapinfo1->busy_block.size != heapinfo2->busy_block.size) @@ -1098,12 +1098,11 @@ int compare_heap_area(simgrid::mc::StateComparator& state, int process_index, } // Check if the blocks are already matched together: - if (state.equals_to1_(block1, frag1).valid_ && state.equals_to2_(block2, frag2).valid_) { - if (offset1==offset2 && state.fragmentsEqual(block1, frag1, block2, frag2)) { - if (match_pairs) - state.match_equals(previous); - return 0; - } + if (state.equals_to1_(block1, frag1).valid_ && state.equals_to2_(block2, frag2).valid_ && offset1 == offset2 && + state.fragmentsEqual(block1, frag1, block2, frag2)) { + if (match_pairs) + state.match_equals(previous); + return 0; } // Compare the size of both fragments: if (heapinfo1->busy_frag.frag_size[frag1] != heapinfo2->busy_frag.frag_size[frag2]) {