From: Frederic Suter Date: Fri, 26 Feb 2016 13:26:24 +0000 (+0100) Subject: Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid X-Git-Tag: v3_13~647^2~12 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/20725839bfdac54bf58497e0c34705ba37f19265?hp=c27e00a13208f33b2df33ef93e12f9ada54bb0d2 Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid --- diff --git a/src/mc/ChunkedData.cpp b/src/mc/ChunkedData.cpp index 8a5d3349f9..cfacbfafda 100644 --- a/src/mc/ChunkedData.cpp +++ b/src/mc/ChunkedData.cpp @@ -9,7 +9,7 @@ #include -#include +#include // xbt_pagesize and friends #include #include "src/mc/AddressSpace.hpp" diff --git a/src/mc/DwarfExpression.hpp b/src/mc/DwarfExpression.hpp index 5063a44af3..6cb4fea66a 100644 --- a/src/mc/DwarfExpression.hpp +++ b/src/mc/DwarfExpression.hpp @@ -10,7 +10,7 @@ #include #include -#include +#include // runtime_error #include #include diff --git a/src/mc/Frame.cpp b/src/mc/Frame.cpp index 5a114d876f..40f9ed363a 100644 --- a/src/mc/Frame.cpp +++ b/src/mc/Frame.cpp @@ -4,6 +4,10 @@ /* 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 + +#include + #include "src/mc/Frame.hpp" namespace simgrid { @@ -13,7 +17,7 @@ void* Frame::frame_base(unw_cursor_t& unw_cursor) const { simgrid::dwarf::Location location = simgrid::dwarf::resolve( frame_base_location, object_info, - &unw_cursor, NULL, NULL, -1); + &unw_cursor, nullptr, nullptr, -1); if (location.in_memory()) return location.address(); else if (location.in_register()) { diff --git a/src/mc/LocationList.cpp b/src/mc/LocationList.cpp index aabcab59b0..2797bc00b4 100644 --- a/src/mc/LocationList.cpp +++ b/src/mc/LocationList.cpp @@ -4,6 +4,15 @@ /* 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 +#include +#include + +#include +#include + +#include + #include "src/mc/mc_dwarf.hpp" #include "src/mc/ObjectInformation.hpp" #include "src/mc/LocationList.hpp" diff --git a/src/mc/ObjectInformation.cpp b/src/mc/ObjectInformation.cpp index 6418c0a45a..43b3a1fa57 100644 --- a/src/mc/ObjectInformation.cpp +++ b/src/mc/ObjectInformation.cpp @@ -4,6 +4,10 @@ /* 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 + +#include + #include "src/mc/Frame.hpp" #include "src/mc/ObjectInformation.hpp" #include "src/mc/Variable.hpp" diff --git a/src/mc/Process.cpp b/src/mc/Process.cpp index 95187eeb30..cb39d09efc 100644 --- a/src/mc/Process.cpp +++ b/src/mc/Process.cpp @@ -8,7 +8,6 @@ #include #include -#include #include #include diff --git a/src/mc/Process.hpp b/src/mc/Process.hpp index 6ecad0e666..bb7194ef8b 100644 --- a/src/mc/Process.hpp +++ b/src/mc/Process.hpp @@ -7,16 +7,17 @@ #ifndef SIMGRID_MC_PROCESS_H #define SIMGRID_MC_PROCESS_H -#include - -#include +#include +#include +#include #include #include -#include "simgrid_config.h" #include +#include + #include #include @@ -32,7 +33,6 @@ #include "src/mc/mc_forward.hpp" #include "src/mc/mc_base.h" -#include "src/mc/mc_mmalloc.h" // std_heap #include "src/mc/AddressSpace.hpp" #include "src/mc/mc_protocol.h" #include "src/mc/ObjectInformation.hpp" diff --git a/src/mc/mc_base.cpp b/src/mc/mc_base.cpp index d7cf4ebc5e..c5ec355463 100644 --- a/src/mc/mc_base.cpp +++ b/src/mc/mc_base.cpp @@ -4,13 +4,18 @@ /* 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 +#include + +#include + +#include +#include +#include #include #include "src/mc/mc_base.h" #include "src/simix/smx_private.h" -#include "src/mc/mc_record.h" #include "src/mc/mc_replay.h" #include "mc/mc.h" #include "src/mc/mc_protocol.h" diff --git a/src/mc/mc_checkpoint.cpp b/src/mc/mc_checkpoint.cpp index 19fb550551..990bf5a6a9 100644 --- a/src/mc/mc_checkpoint.cpp +++ b/src/mc/mc_checkpoint.cpp @@ -15,7 +15,6 @@ #include "xbt/module.h" #include #include "src/smpi/private.h" -#include #include "src/xbt/mmalloc/mmprivate.h" diff --git a/src/mc/mc_client.cpp b/src/mc/mc_client.cpp index 07e65fb66c..733ecba4e4 100644 --- a/src/mc/mc_client.cpp +++ b/src/mc/mc_client.cpp @@ -19,7 +19,6 @@ #include "src/mc/mc_client.h" // We won't need those once the separation MCer/MCed is complete: -#include "src/mc/mc_mmalloc.h" #include "src/mc/mc_ignore.h" #include "src/mc/mc_private.h" // MC_deadlock_check() #include "src/mc/mc_smx.h" diff --git a/src/mc/mc_client_api.cpp b/src/mc/mc_client_api.cpp index 9bbceb0248..21a1db98d3 100644 --- a/src/mc/mc_client_api.cpp +++ b/src/mc/mc_client_api.cpp @@ -11,7 +11,6 @@ #include "src/mc/mc_record.h" #include "src/mc/mc_private.h" -#include "src/mc/mc_mmalloc.h" #include "src/mc/mc_ignore.h" #include "src/mc/mc_protocol.h" #include "src/mc/mc_client.h" diff --git a/src/mc/mc_global.cpp b/src/mc/mc_global.cpp index d692f5e09f..6b9b8e7126 100644 --- a/src/mc/mc_global.cpp +++ b/src/mc/mc_global.cpp @@ -11,6 +11,8 @@ #include "mc_base.h" +#include "mc/mc.h" + #ifndef _XBT_WIN32 #include #include @@ -20,6 +22,8 @@ #include #include +#include "src/simix/smx_process_private.h" + #ifdef HAVE_MC #include #include "src/mc/mc_comm_pattern.h" diff --git a/src/mc/mc_liveness.cpp b/src/mc/mc_liveness.cpp index bb3fadc375..73995faf6f 100644 --- a/src/mc/mc_liveness.cpp +++ b/src/mc/mc_liveness.cpp @@ -4,11 +4,17 @@ /* 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 + #include #include -#include #include +#include +#include +#include +#include +#include #include "src/mc/mc_request.h" #include "src/mc/mc_liveness.h" @@ -154,7 +160,7 @@ static int MC_automaton_evaluate_label(xbt_automaton_exp_label_t l, unsigned int cursor = 0; xbt_automaton_propositional_symbol_t p = NULL; xbt_dynar_foreach(_mc_property_automaton->propositional_symbols, cursor, p) { - if (strcmp(xbt_automaton_propositional_symbol_get_name(p), l->u.predicat) == 0) + if (std::strcmp(xbt_automaton_propositional_symbol_get_name(p), l->u.predicat) == 0) return (int) xbt_dynar_get_as(atomic_propositions_values, cursor, int); } return -1; diff --git a/src/mc/mc_liveness.h b/src/mc/mc_liveness.h index f33cc5428e..72142a7c95 100644 --- a/src/mc/mc_liveness.h +++ b/src/mc/mc_liveness.h @@ -10,6 +10,7 @@ #include #include +#include #include #include #include diff --git a/src/mc/mc_member.cpp b/src/mc/mc_member.cpp index e709912500..a6f7e6df9a 100644 --- a/src/mc/mc_member.cpp +++ b/src/mc/mc_member.cpp @@ -4,13 +4,10 @@ /* 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 - #include "src/mc/mc_private.h" #include "src/mc/Type.hpp" #include "src/mc/mc_dwarf.hpp" - namespace simgrid { namespace dwarf { diff --git a/src/mc/mc_mmalloc.h b/src/mc/mc_mmalloc.h index 9fe096893e..e69de29bb2 100644 --- a/src/mc/mc_mmalloc.h +++ b/src/mc/mc_mmalloc.h @@ -1,37 +0,0 @@ -/* Copyright (c) 2007-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. */ - -#ifndef SIMGRID_MC_MMALLOC_H -#define SIMGRID_MC_MMALLOC_H - -#include -#include - -/** file - * Support for seperate heaps. - * - * The possible memory modes for the modelchecker are standard and raw. - * Normally the system should operate in std, for switching to raw mode - * you must wrap the code between MC_SET_RAW_MODE and MC_UNSET_RAW_MODE. - */ - -SG_BEGIN_DECL() - -/* FIXME: Horrible hack! because the mmalloc library doesn't provide yet of */ -/* an API to query about the status of a heap, we simply call mmstats and */ -/* because I now how does structure looks like, then I redefine it here */ - -/* struct mstats { */ -/* size_t bytes_total; /\* Total size of the heap. *\/ */ -/* size_t chunks_used; /\* Chunks allocated by the user. *\/ */ -/* size_t bytes_used; /\* Byte total of user-allocated chunks. *\/ */ -/* size_t chunks_free; /\* Chunks in the free list. *\/ */ -/* size_t bytes_free; /\* Byte total of chunks in the free list. *\/ */ -/* }; */ - -SG_END_DECL() - -#endif diff --git a/src/mc/mc_mmu.h b/src/mc/mc_mmu.h index 6968f7bd38..e0236e56dd 100644 --- a/src/mc/mc_mmu.h +++ b/src/mc/mc_mmu.h @@ -7,8 +7,7 @@ #ifndef SIMGRID_MC_MMU_H #define SIMGRID_MC_MMU_H -#include -#include +#include #include #include @@ -41,7 +40,7 @@ static inline __attribute__ ((always_inline)) size_t mc_page_number(const void* base, const void* address) { xbt_assert(address>=base, "The address is not in the range"); - return ((uintptr_t) address - (uintptr_t) base) >> xbt_pagebits; + return ((std::uintptr_t) address - (std::uintptr_t) base) >> xbt_pagebits; } /** @brief Get the offset of an address within a memory page @@ -52,7 +51,7 @@ size_t mc_page_number(const void* base, const void* address) static inline __attribute__ ((always_inline)) size_t mc_page_offset(const void* address) { - return ((uintptr_t) address) & (xbt_pagesize-1); + return ((std::uintptr_t) address) & (xbt_pagesize-1); } /** @brief Get the virtual address of a virtual memory page @@ -69,7 +68,8 @@ void* mc_page_from_number(const void* base, size_t page) static inline __attribute__ ((always_inline)) bool mc_same_page(const void* a, const void* b) { - return ((uintptr_t) a >> xbt_pagebits) == ((uintptr_t) b >> xbt_pagebits); + return ((std::uintptr_t) a >> xbt_pagebits) + == ((std::uintptr_t) b >> xbt_pagebits); } SG_END_DECL() diff --git a/src/mc/mc_record.cpp b/src/mc/mc_record.cpp index 4541cef903..9ac3ecb536 100644 --- a/src/mc/mc_record.cpp +++ b/src/mc/mc_record.cpp @@ -8,8 +8,14 @@ #include #include +#include +#include + #include "simgrid/simix.h" +#include "src/simix/smx_private.h" +#include "src/simix/smx_process_private.h" + #include "src/mc/mc_replay.h" #include "src/mc/mc_record.h" #include "src/mc/mc_base.h" diff --git a/src/mc/mc_record.h b/src/mc/mc_record.h index b050ee5248..94f6040c81 100644 --- a/src/mc/mc_record.h +++ b/src/mc/mc_record.h @@ -17,8 +17,6 @@ #ifndef SIMGRID_MC_RECORD_H #define SIMGRID_MC_RECORD_H -#include - #include SG_BEGIN_DECL() diff --git a/src/mc/mc_request.cpp b/src/mc/mc_request.cpp index c77bc95719..cee83301b2 100644 --- a/src/mc/mc_request.cpp +++ b/src/mc/mc_request.cpp @@ -4,7 +4,13 @@ /* 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 +#include + +#include +#include +#include +#include +#include #include "src/mc/mc_request.h" #include "src/mc/mc_safety.h" diff --git a/src/mc/mc_request.h b/src/mc/mc_request.h index 55fa040965..1ca589c922 100644 --- a/src/mc/mc_request.h +++ b/src/mc/mc_request.h @@ -9,8 +9,6 @@ #include -#include - #include "src/simix/smx_private.h" SG_BEGIN_DECL() diff --git a/src/mc/mc_safety.cpp b/src/mc/mc_safety.cpp index 160fea3c88..4beb1d595c 100644 --- a/src/mc/mc_safety.cpp +++ b/src/mc/mc_safety.cpp @@ -4,7 +4,13 @@ /* 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 +#include + +#include + +#include +#include +#include #include "src/mc/mc_state.h" #include "src/mc/mc_request.h" @@ -142,12 +148,12 @@ int MC_modelcheck_safety(void) ); if (dot_output != NULL) - fprintf(dot_output, "\"%d\" -> \"%d\" [%s];\n", state->num, next_state->num, req_str); + std::fprintf(dot_output, "\"%d\" -> \"%d\" [%s];\n", state->num, next_state->num, req_str); } else { if (dot_output != NULL) - fprintf(dot_output, "\"%d\" -> \"%d\" [%s];\n", state->num, visited_state->other_num == -1 ? visited_state->num : visited_state->other_num, req_str); + std::fprintf(dot_output, "\"%d\" -> \"%d\" [%s];\n", state->num, visited_state->other_num == -1 ? visited_state->num : visited_state->other_num, req_str); } diff --git a/src/mc/mc_safety.h b/src/mc/mc_safety.h index d6c907dcb7..46c5ec95dc 100644 --- a/src/mc/mc_safety.h +++ b/src/mc/mc_safety.h @@ -10,8 +10,10 @@ #include #include + #include -#include +#include + #include "src/mc/mc_forward.hpp" #include "src/mc/mc_state.h" diff --git a/src/mc/mc_smx.cpp b/src/mc/mc_smx.cpp index c24b2ac3be..a9dfb37266 100644 --- a/src/mc/mc_smx.cpp +++ b/src/mc/mc_smx.cpp @@ -4,7 +4,7 @@ /* 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 +#include #include #include diff --git a/src/mc/mc_smx.h b/src/mc/mc_smx.h index 7de26cfa74..31fdaba5f3 100644 --- a/src/mc/mc_smx.h +++ b/src/mc/mc_smx.h @@ -9,7 +9,9 @@ #include +#include #include + #include #include "src/smpi/private.h" diff --git a/src/mc/mc_snapshot.cpp b/src/mc/mc_snapshot.cpp index fdcae06bcb..aacc9d1cfb 100644 --- a/src/mc/mc_snapshot.cpp +++ b/src/mc/mc_snapshot.cpp @@ -4,7 +4,13 @@ /* 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 +#include + +#include +#include + +#include +#include #include "src/internal_config.h" #include "src/smpi/private.h" diff --git a/src/mc/mc_snapshot.h b/src/mc/mc_snapshot.h index 47bfc14d51..45db54c6c1 100644 --- a/src/mc/mc_snapshot.h +++ b/src/mc/mc_snapshot.h @@ -7,23 +7,24 @@ #ifndef SIMGRID_MC_SNAPSHOT_H #define SIMGRID_MC_SNAPSHOT_H -#include // off_t -#include // size_t +#include +#include #include #include +#include #include +#include // off_t + #include #include "src/xbt/mmalloc/mmprivate.h" #include -#include #include #include "src/mc/mc_forward.hpp" #include "src/mc/ModelChecker.hpp" #include "src/mc/PageStore.hpp" -#include "src/mc/mc_mmalloc.h" #include "src/mc/AddressSpace.hpp" #include "src/mc/mc_unw.h" #include "src/mc/RegionSnapshot.hpp" diff --git a/src/mc/mc_state.cpp b/src/mc/mc_state.cpp index 3720ff795d..7786efd949 100644 --- a/src/mc/mc_state.cpp +++ b/src/mc/mc_state.cpp @@ -6,8 +6,11 @@ #include +#include +#include +#include + #include "src/simix/smx_private.h" -#include "xbt/fifo.h" #include "src/mc/mc_state.h" #include "src/mc/mc_request.h" #include "src/mc/mc_private.h" diff --git a/src/mc/mc_state.h b/src/mc/mc_state.h index 8ab1b11fa5..40c9a6eb33 100644 --- a/src/mc/mc_state.h +++ b/src/mc/mc_state.h @@ -8,6 +8,7 @@ #define SIMGRID_MC_STATE_H #include +#include #include #include "src/simix/smx_private.h" diff --git a/src/mc/mc_unw.h b/src/mc/mc_unw.h index 53982a0b9e..3470bd8580 100644 --- a/src/mc/mc_unw.h +++ b/src/mc/mc_unw.h @@ -28,6 +28,8 @@ #include +#include + #include "src/mc/Process.hpp" SG_BEGIN_DECL() diff --git a/src/mc/mc_visited.cpp b/src/mc/mc_visited.cpp index 7634c31925..391f445669 100644 --- a/src/mc/mc_visited.cpp +++ b/src/mc/mc_visited.cpp @@ -7,6 +7,12 @@ #include #include +#include +#include +#include +#include +#include + #include "src/mc/mc_comm_pattern.h" #include "src/mc/mc_safety.h" #include "src/mc/mc_liveness.h" diff --git a/src/mc/mc_xbt.cpp b/src/mc/mc_xbt.cpp index 6c832f89cb..8a2ff912f1 100644 --- a/src/mc/mc_xbt.cpp +++ b/src/mc/mc_xbt.cpp @@ -4,16 +4,19 @@ /* 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 +#include +#include "src/mc/remote_ptr.hpp" #include "src/mc/AddressSpace.hpp" #include "src/mc/mc_xbt.hpp" +#include + namespace simgrid { namespace mc { void read_element(AddressSpace const& as, - void* local, remote_ptr addr, size_t i, size_t len) + void* local, remote_ptr addr, std::size_t i, std::size_t len) { s_xbt_dynar_t d; as.read_bytes(&d, sizeof(d), addr); diff --git a/src/mc/mc_xbt.hpp b/src/mc/mc_xbt.hpp index e6dbd53e8e..4640bfff9e 100644 --- a/src/mc/mc_xbt.hpp +++ b/src/mc/mc_xbt.hpp @@ -7,15 +7,18 @@ #ifndef SIMGRID_MC_XBT_HPP #define SIMGRID_MC_XBT_HPP +#include + #include +#include "src/mc/remote_ptr.hpp" #include "src/mc/AddressSpace.hpp" namespace simgrid { namespace mc { XBT_PRIVATE void read_element(AddressSpace const& as, - void* local, remote_ptr addr, size_t i, size_t len); + void* local, remote_ptr addr, std::size_t i, std::size_t len); XBT_PRIVATE std::size_t read_length( AddressSpace const& as, remote_ptr addr); diff --git a/tools/cmake/DefinePackages.cmake b/tools/cmake/DefinePackages.cmake index 726c2476e7..cc808afb2d 100644 --- a/tools/cmake/DefinePackages.cmake +++ b/tools/cmake/DefinePackages.cmake @@ -582,7 +582,6 @@ set(MC_SRC src/mc/mc_unw.h src/mc/mc_unw.cpp src/mc/mc_unw_vmread.cpp - src/mc/mc_mmalloc.h src/mc/mc_object_info.h src/mc/mc_checkpoint.cpp src/mc/mc_snapshot.h