blob: a9f81c484c21092404f637a83367745b603a6577 [file] [log] [blame]
Avi Drissmane4622aa2022-09-08 20:36:061// Copyright 2021 The Chromium Authors
Takashi Sakamoto31cfff642021-10-29 05:47:292// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef BASE_ALLOCATOR_PARTITION_ALLOC_SUPPORT_H_
6#define BASE_ALLOCATOR_PARTITION_ALLOC_SUPPORT_H_
7
Bartek Nowierski3f1ae092021-12-16 00:12:198#include <map>
9#include <string>
10
Takashi Sakamoto31cfff642021-10-29 05:47:2911#include "base/allocator/partition_allocator/partition_alloc_config.h"
12#include "base/base_export.h"
Takashi Sakamotob339487e2021-11-09 12:43:4613#include "base/memory/scoped_refptr.h"
14#include "base/task/sequenced_task_runner.h"
Takashi Sakamoto31cfff642021-10-29 05:47:2915
16namespace base {
17namespace allocator {
18
19#if defined(PA_ALLOW_PCSCAN)
20BASE_EXPORT void RegisterPCScanStatsReporter();
21#endif
22
Takashi Sakamotob339487e2021-11-09 12:43:4623// Starts a periodic timer on the current thread to purge all thread caches.
24BASE_EXPORT void StartThreadCachePeriodicPurge();
25
26BASE_EXPORT void StartMemoryReclaimer(
27 scoped_refptr<SequencedTaskRunner> task_runner);
28
Bartek Nowierski145f4f462022-02-24 00:38:4129BASE_EXPORT std::map<std::string, std::string> ProposeSyntheticFinchTrials();
Bartek Nowierski3f1ae092021-12-16 00:12:1930
Arthur Sonzogni0db17dd2022-02-14 13:50:2731// Install handlers for when dangling raw_ptr(s) have been detected. This prints
32// two StackTraces. One where the memory is freed, one where the last dangling
33// raw_ptr stopped referencing it.
34//
35// This is currently effective, only when compiled with
36// `enable_dangling_raw_ptr_checks` build flag.
37BASE_EXPORT void InstallDanglingRawPtrChecks();
38
Takashi Sakamoto31cfff642021-10-29 05:47:2939} // namespace allocator
40} // namespace base
41
42#endif // BASE_ALLOCATOR_PARTITION_ALLOC_SUPPORT_H_