*
* It can hash pairs: the standard hash currently doesn't include this.
*/
-template<class X> struct hash : public std::hash<X> {};
+template <class X> class hash : public std::hash<X> {
+};
template <class X, class Y> class hash<std::pair<X, Y>> {
public:
// This is in snapshot do not use them directly:
const malloc_info* heapinfos1 = snapshot1->read<malloc_info*>(
- (std::uint64_t)heapinfo_address, simgrid::mc::ProcessIndexMissing);
+ RemotePtr<malloc_info*>((std::uint64_t)heapinfo_address), simgrid::mc::ProcessIndexMissing);
const malloc_info* heapinfos2 = snapshot2->read<malloc_info*>(
- (std::uint64_t)heapinfo_address, simgrid::mc::ProcessIndexMissing);
+ RemotePtr<malloc_info*>((std::uint64_t)heapinfo_address), simgrid::mc::ProcessIndexMissing);
while (i1 < state.heaplimit) {
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)
}
// 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]) {