Skip to content
Snippets Groups Projects

Free the offsets array at the end of the particle sorting routines.

Merged Matthieu Schaller requested to merge memory_leak into master
1 file
+ 9
3
Compare changes
  • Side-by-side
  • Inline
+ 9
3
@@ -1420,7 +1420,9 @@ void space_parts_sort(struct part *parts, struct xpart *xparts, int *ind,
for (int k = 0; k < num_bins; k++)
if (offsets[k + 1] != offsets[k] + counts[k])
error("Bad offsets after shuffle.");
#endif // SWIFT_DEBUG_CHECKS
#endif /* SWIFT_DEBUG_CHECKS */
free(offsets);
}
/**
@@ -1475,7 +1477,9 @@ void space_sparts_sort(struct spart *sparts, int *ind, int *counts,
for (int k = 0; k < num_bins; k++)
if (offsets[k + 1] != offsets[k] + counts[k])
error("Bad offsets after shuffle.");
#endif // SWIFT_DEBUG_CHECKS
#endif /* SWIFT_DEBUG_CHECKS */
free(offsets);
}
/**
@@ -1537,7 +1541,9 @@ void space_gparts_sort(struct gpart *gparts, struct part *parts,
for (int k = 0; k < num_bins; k++)
if (offsets[k + 1] != offsets[k] + counts[k])
error("Bad offsets after shuffle.");
#endif // SWIFT_DEBUG_CHECKS
#endif /* SWIFT_DEBUG_CHECKS */
free(offsets);
}
/**
Loading