#include "mc/mc.h"
#include "xbt/mmalloc.h"
#include "mc/datatypes.h"
+#include "src/mc/malloc.hpp"
#include "src/mc/mc_private.h"
#include "src/mc/mc_snapshot.h"
#include "src/mc/mc_dwarf.hpp"
using simgrid::mc::remote;
-extern "C" {
-
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_diff, xbt,
"Logging specific to mc_diff in mc");
/*********************************** Heap comparison ***********************************/
/***************************************************************************************/
-typedef char *type_name;
-
struct XBT_PRIVATE s_mc_diff {
s_xbt_mheap_t std_heap_copy;
std::size_t heaplimit;
return 0;
}
-}
+namespace simgrid {
+namespace mc {
int init_heap_information(xbt_mheap_t heap1, xbt_mheap_t heap2,
std::vector<simgrid::mc::IgnoredHeapRegion>* i1,
memset(state->equals_to2, 0,
state->heaplimit * MAX_FRAGMENT_PER_BLOCK * sizeof(s_heap_area_t));
memset(state->types1, 0,
- state->heaplimit * MAX_FRAGMENT_PER_BLOCK * sizeof(type_name *));
+ state->heaplimit * MAX_FRAGMENT_PER_BLOCK * sizeof(char**));
memset(state->types2, 0,
- state->heaplimit * MAX_FRAGMENT_PER_BLOCK * sizeof(type_name *));
+ state->heaplimit * MAX_FRAGMENT_PER_BLOCK * sizeof(char**));
return 0;
}
-extern "C" {
-
void reset_heap_information()
{
// TODO, have a robust way to find it in O(1)
static inline
-mc_mem_region_t MC_get_heap_region(mc_snapshot_t snapshot)
+mc_mem_region_t MC_get_heap_region(simgrid::mc::Snapshot* snapshot)
{
size_t n = snapshot->snapshot_regions.size();
for (size_t i=0; i!=n; ++i) {
xbt_die("No heap region");
}
-int mmalloc_compare_heap(mc_snapshot_t snapshot1, mc_snapshot_t snapshot2)
+int mmalloc_compare_heap(simgrid::mc::Snapshot* snapshot1, simgrid::mc::Snapshot* snapshot2)
{
simgrid::mc::Process* process = &mc_model_checker->process();
struct s_mc_diff *state = mc_diff_info;
*/
static int compare_heap_area_without_type(struct s_mc_diff *state, int process_index,
const void *real_area1, const void *real_area2,
- mc_snapshot_t snapshot1,
- mc_snapshot_t snapshot2,
+ simgrid::mc::Snapshot* snapshot1,
+ simgrid::mc::Snapshot* snapshot2,
xbt_dynar_t previous, int size,
int check_ignore)
{
*/
static int compare_heap_area_with_type(struct s_mc_diff *state, int process_index,
const void *real_area1, const void *real_area2,
- mc_snapshot_t snapshot1,
- mc_snapshot_t snapshot2,
+ simgrid::mc::Snapshot* snapshot1,
+ simgrid::mc::Snapshot* snapshot2,
xbt_dynar_t previous, simgrid::mc::Type* type,
int area_size, int check_ignore,
int pointer_level)
*/
static simgrid::mc::Type* get_offset_type(void *real_base_address, simgrid::mc::Type* type,
int offset, int area_size,
- mc_snapshot_t snapshot, int process_index)
+ simgrid::mc::Snapshot* snapshot, int process_index)
{
// Beginning of the block, the infered variable type if the type of the block:
* @param pointer_level
* @return 0 (same), 1 (different), -1
*/
-int compare_heap_area(int process_index, const void *area1, const void *area2, mc_snapshot_t snapshot1,
- mc_snapshot_t snapshot2, xbt_dynar_t previous,
+int compare_heap_area(int process_index, const void *area1, const void *area2, simgrid::mc::Snapshot* snapshot1,
+ simgrid::mc::Snapshot* snapshot2, xbt_dynar_t previous,
simgrid::mc::Type* type, int pointer_level)
{
simgrid::mc::Process* process = &mc_model_checker->process();
#endif
}
+}