summaryrefslogtreecommitdiffstats
path: root/chromium/base/sampling_heap_profiler/poisson_allocation_sampler.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-08-30 10:22:43 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-08-30 12:36:28 +0000
commit271a6c3487a14599023a9106329505597638d793 (patch)
treee040d58ffc86c1480b79ca8528020ca9ec919bf8 /chromium/base/sampling_heap_profiler/poisson_allocation_sampler.h
parent7b2ffa587235a47d4094787d72f38102089f402a (diff)
BASELINE: Update Chromium to 77.0.3865.59
Change-Id: I1e89a5f3b009a9519a6705102ad65c92fe736f21 Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/base/sampling_heap_profiler/poisson_allocation_sampler.h')
-rw-r--r--chromium/base/sampling_heap_profiler/poisson_allocation_sampler.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/chromium/base/sampling_heap_profiler/poisson_allocation_sampler.h b/chromium/base/sampling_heap_profiler/poisson_allocation_sampler.h
index f0751e4470c..3178ef7be83 100644
--- a/chromium/base/sampling_heap_profiler/poisson_allocation_sampler.h
+++ b/chromium/base/sampling_heap_profiler/poisson_allocation_sampler.h
@@ -8,7 +8,9 @@
#include <vector>
#include "base/base_export.h"
+#include "base/compiler_specific.h"
#include "base/macros.h"
+#include "base/sampling_heap_profiler/lock_free_address_hash_set.h"
#include "base/synchronization/lock.h"
namespace base {
@@ -16,8 +18,6 @@ namespace base {
template <typename T>
class NoDestructor;
-class LockFreeAddressHashSet;
-
// This singleton class implements Poisson sampling of the incoming allocations
// stream. It hooks onto base::allocator and base::PartitionAlloc.
// An extra custom allocator can be hooked via SetHooksInstallCallback method.
@@ -86,7 +86,7 @@ class BASE_EXPORT PoissonAllocationSampler {
size_t,
AllocatorType,
const char* context);
- static void RecordFree(void* address);
+ ALWAYS_INLINE static void RecordFree(void* address);
static PoissonAllocationSampler* Get();
@@ -120,6 +120,14 @@ class BASE_EXPORT PoissonAllocationSampler {
DISALLOW_COPY_AND_ASSIGN(PoissonAllocationSampler);
};
+// static
+ALWAYS_INLINE void PoissonAllocationSampler::RecordFree(void* address) {
+ if (UNLIKELY(address == nullptr))
+ return;
+ if (UNLIKELY(sampled_addresses_set().Contains(address)))
+ instance_->DoRecordFree(address);
+}
+
} // namespace base
#endif // BASE_SAMPLING_HEAP_PROFILER_POISSON_ALLOCATION_SAMPLER_H_