const malloc_info* heapinfos2 = snapshot2->read<malloc_info*>(
(std::uint64_t)heapinfo_address, simgrid::mc::ProcessIndexMissing);
- while (i1 <= state->heaplimit) {
+ while (i1 < state->heaplimit) {
const malloc_info* heapinfo1 = (const malloc_info*) MC_region_read(heap_region1, &heapinfo_temp1, &heapinfos1[i1], sizeof(malloc_info));
const malloc_info* heapinfo2 = (const malloc_info*) MC_region_read(heap_region2, &heapinfo_temp2, &heapinfos2[i1], sizeof(malloc_info));
res_compare =
compare_heap_area(simgrid::mc::ProcessIndexMissing, addr_block1, addr_block2, snapshot1, snapshot2,
- nullptr, NULL, 0);
+ nullptr, nullptr, 0);
if (res_compare != 1) {
for (k = 1; k < heapinfo2->busy_block.size; k++)
}
- while (i2 <= state->heaplimit && !equal) {
+ while (i2 < state->heaplimit && !equal) {
addr_block2 = (ADDR2UINT(i2) - 1) * BLOCKSIZE +
(char *) state->std_heap_copy.heapbase;
res_compare =
compare_heap_area(simgrid::mc::ProcessIndexMissing, addr_block1, addr_block2, snapshot1, snapshot2,
- nullptr, NULL, 0);
+ nullptr, nullptr, 0);
if (res_compare != 1) {
for (k = 1; k < heapinfo2b->busy_block.size; k++)
res_compare =
compare_heap_area(simgrid::mc::ProcessIndexMissing, addr_frag1, addr_frag2, snapshot1, snapshot2,
- nullptr, NULL, 0);
+ nullptr, nullptr, 0);
if (res_compare != 1)
equal = 1;
}
- while (i2 <= state->heaplimit && !equal) {
+ while (i2 < state->heaplimit && !equal) {
const malloc_info* heapinfo2b = (const malloc_info*) MC_region_read(
heap_region2, &heapinfo_temp2b, &heapinfos2[i2],
res_compare =
compare_heap_area(simgrid::mc::ProcessIndexMissing, addr_frag1, addr_frag2, snapshot2, snapshot2,
- nullptr, NULL, 0);
+ nullptr, nullptr, 0);
if (res_compare != 1) {
equal = 1;
/* All blocks/fragments are equal to another block/fragment ? */
size_t i = 1, j = 0;
- for(i = 1; i <= state->heaplimit; i++) {
+ for(i = 1; i < state->heaplimit; i++) {
const malloc_info* heapinfo1 = (const malloc_info*) MC_region_read(
heap_region1, &heapinfo_temp1, &heapinfos1[i], sizeof(malloc_info));
if (heapinfo1->type == MMALLOC_TYPE_UNFRAGMENTED) {
// TODO, add address
XBT_DEBUG("Block %zu not found (size used = %zu)", i,
heapinfo1->busy_block.busy_size);
- //mmalloc_backtrace_block_display((void*)heapinfo1, i);
}
nb_diff1++;
}
("Block %zu, Fragment %zu not found (size used = %zd)",
i, j,
heapinfo1->busy_frag.frag_size[j]);
- //mmalloc_backtrace_fragment_display((void*)heapinfo1, i, j);
}
nb_diff1++;
}
if (i1 == state->heaplimit)
XBT_DEBUG("Number of blocks/fragments not found in heap1 : %d", nb_diff1);
- for (i=1; i <= state->heaplimit; i++) {
+ for (i=1; i < state->heaplimit; i++) {
const malloc_info* heapinfo2 = (const malloc_info*) MC_region_read(
heap_region2, &heapinfo_temp2, &heapinfos2[i], sizeof(malloc_info));
if (heapinfo2->type == MMALLOC_TYPE_UNFRAGMENTED) {
// TODO, print address of the block
XBT_DEBUG("Block %zu not found (size used = %zu)", i,
heapinfo2->busy_block.busy_size);
- //mmalloc_backtrace_block_display((void*)heapinfo2, i);
}
nb_diff2++;
}
("Block %zu, Fragment %zu not found (size used = %zd)",
i, j,
heapinfo2->busy_frag.frag_size[j]);
- //mmalloc_backtrace_fragment_display((void*)heapinfo2, i, j);
}
nb_diff2++;
}
int type_size = -1;
int offset1 = 0, offset2 = 0;
int new_size1 = -1, new_size2 = -1;
- simgrid::mc::Type *new_type1 = nullptr, *new_type2 = NULL;
+ simgrid::mc::Type *new_type1 = nullptr, *new_type2 = nullptr;
int match_pairs = 0;
return -1;
}
- if (new_type1 != nullptr && new_type2 != NULL && new_type1 != new_type2) {
+ if (new_type1 != nullptr && new_type2 != nullptr && new_type1 != new_type2) {
type = new_type1;
while (type->byte_size == 0 && type->subtype != nullptr)