Skip to content

Commit bbe531c

Browse files
committed
[Basic] MaxMallocUsage statistic should cover all zones
Also for some reason passing `malloc_default_zone()` no longer works, statistics return `0` use.
1 parent b7c2cb8 commit bbe531c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/Basic/Statistic.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,8 @@ void updateProcessWideFrontendCounters(
530530
// On Darwin we have a lifetime max that's maintained by malloc we can
531531
// just directly query, even if we only make one query on shutdown.
532532
malloc_statistics_t Stats;
533-
malloc_zone_statistics(malloc_default_zone(), &Stats);
533+
// Query all zones.
534+
malloc_zone_statistics(/*zone=*/NULL, &Stats);
534535
C.MaxMallocUsage = (int64_t)Stats.max_size_in_use;
535536
#else
536537
// If we don't have a malloc-tracked max-usage counter, we have to rely

0 commit comments

Comments
 (0)