size_t heaplimit;
// Number of blocks in the heaps:
size_t heapsize1, heapsize2;
- xbt_dynar_t to_ignore1, to_ignore2;
+ std::vector<s_mc_heap_ignore_region_t>* to_ignore1;
+ std::vector<s_mc_heap_ignore_region_t>* to_ignore2;
s_heap_area_t *equals_to1, *equals_to2;
dw_type_t *types1, *types2;
size_t available;
return 0;
}
-static ssize_t heap_comparison_ignore_size(xbt_dynar_t ignore_list,
+static ssize_t heap_comparison_ignore_size(std::vector<s_mc_heap_ignore_region_t>* ignore_list,
const void *address)
{
-
- unsigned int cursor = 0;
int start = 0;
- int end = xbt_dynar_length(ignore_list) - 1;
- mc_heap_ignore_region_t region;
+ int end = ignore_list->size() - 1;
while (start <= end) {
- cursor = (start + end) / 2;
- region =
- (mc_heap_ignore_region_t) xbt_dynar_get_as(ignore_list, cursor,
- mc_heap_ignore_region_t);
- if (region->address == address)
- return region->size;
- if (region->address < address)
+ unsigned int cursor = (start + end) / 2;
+ s_mc_heap_ignore_region_t region = (*ignore_list)[cursor];
+ if (region.address == address)
+ return region.size;
+ if (region.address < address)
start = cursor + 1;
- if (region->address > address)
+ if (region.address > address)
end = cursor - 1;
}
return 0;
}
-int init_heap_information(xbt_mheap_t heap1, xbt_mheap_t heap2, xbt_dynar_t i1,
- xbt_dynar_t i2)
+}
+
+int init_heap_information(xbt_mheap_t heap1, xbt_mheap_t heap2,
+ std::vector<s_mc_heap_ignore_region_t>* i1,
+ std::vector<s_mc_heap_ignore_region_t>* i2)
{
if (mc_diff_info == NULL) {
mc_diff_info = xbt_new0(struct s_mc_diff, 1);
}
+extern "C" {
+
void reset_heap_information()
{
static inline
mc_mem_region_t MC_get_heap_region(mc_snapshot_t snapshot)
{
- size_t n = snapshot->snapshot_regions_count;
+ size_t n = snapshot->snapshot_regions.size();
for (size_t i=0; i!=n; ++i) {
- mc_mem_region_t region = snapshot->snapshot_regions[i];
+ mc_mem_region_t region = snapshot->snapshot_regions[i].get();
if (region->region_type() == simgrid::mc::RegionType::Heap)
return region;
}
}
}
-// Not used:
-char *get_type_description(mc_object_info_t info, char *type_name)
-{
-
- xbt_dict_cursor_t dict_cursor;
- char *type_origin;
- dw_type_t type;
-
- xbt_dict_foreach(info->types, dict_cursor, type_origin, type) {
- if (type->name && (strcmp(type->name, type_name) == 0)
- && type->byte_size > 0) {
- xbt_dict_cursor_free(&dict_cursor);
- return type_origin;
- }
- }
-
- xbt_dict_cursor_free(&dict_cursor);
- return NULL;
-}
-
-
#ifndef max
#define max( a, b ) ( ((a) > (b)) ? (a) : (b) )
#endif