Skip to content

Commit ce11162

Browse files
authored
Merge pull request #68412 from xedin/reenable-malloc-memory-tracking
[Basic] `MaxMallocUsage` statistic should cover all zones
2 parents f3bbb78 + bbe531c commit ce11162

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)