partition_alloc_support.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Copyright 2021 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef BASE_ALLOCATOR_PARTITION_ALLOC_SUPPORT_H_
  5. #define BASE_ALLOCATOR_PARTITION_ALLOC_SUPPORT_H_
  6. #include <map>
  7. #include <string>
  8. #include "base/allocator/partition_allocator/partition_alloc_config.h"
  9. #include "base/base_export.h"
  10. #include "base/memory/scoped_refptr.h"
  11. #include "base/task/sequenced_task_runner.h"
  12. namespace base {
  13. namespace allocator {
  14. #if defined(PA_ALLOW_PCSCAN)
  15. BASE_EXPORT void RegisterPCScanStatsReporter();
  16. #endif
  17. // Starts a periodic timer on the current thread to purge all thread caches.
  18. BASE_EXPORT void StartThreadCachePeriodicPurge();
  19. BASE_EXPORT void StartMemoryReclaimer(
  20. scoped_refptr<SequencedTaskRunner> task_runner);
  21. BASE_EXPORT std::map<std::string, std::string> ProposeSyntheticFinchTrials();
  22. // Install handlers for when dangling raw_ptr(s) have been detected. This prints
  23. // two StackTraces. One where the memory is freed, one where the last dangling
  24. // raw_ptr stopped referencing it.
  25. //
  26. // This is currently effective, only when compiled with
  27. // `enable_dangling_raw_ptr_checks` build flag.
  28. BASE_EXPORT void InstallDanglingRawPtrChecks();
  29. } // namespace allocator
  30. } // namespace base
  31. #endif // BASE_ALLOCATOR_PARTITION_ALLOC_SUPPORT_H_