Skip to content

Commit

Permalink
Disallow events while reclaiming partition allocator memory (#748)
Browse files Browse the repository at this point in the history
  • Loading branch information
bhackett1024 committed Jun 23, 2023
1 parent 879aa95 commit 0539d29
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions base/allocator/partition_alloc_support.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
#include "base/allocator/partition_allocator/starscan/stats_reporter.h"
#endif // BUILDFLAG(STARSCAN)

#include "base/record_replay.h"

namespace base {
namespace allocator {

Expand Down Expand Up @@ -190,6 +192,10 @@ void RunMemoryReclaimer(scoped_refptr<SequencedTaskRunner> task_runner) {
auto* instance = ::partition_alloc::MemoryReclaimer::Instance();

{
// The memory reclaimer runs at consistent points when recording vs. replaying,
// but can behave differently.
recordreplay::AutoDisallowEvents disallow("RunMemoryReclaimer");

// Micros, since memory reclaiming should typically take at most a few ms.
SCOPED_UMA_HISTOGRAM_TIMER_MICROS("Memory.PartitionAlloc.MemoryReclaim");
instance->ReclaimNormal();
Expand Down

0 comments on commit 0539d29

Please sign in to comment.