extended_api.h 995 B

123456789101112131415161718192021222324
  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_ALLOCATOR_EXTENDED_API_H_
  5. #define BASE_ALLOCATOR_PARTITION_ALLOCATOR_EXTENDED_API_H_
  6. #include "base/allocator/partition_allocator/partition_root.h"
  7. #include "base/allocator/partition_allocator/thread_cache.h"
  8. namespace partition_alloc::internal {
  9. // These two functions are unsafe to run if there are multiple threads running
  10. // in the process.
  11. //
  12. // Disables the thread cache for the entire process, and replaces it with a
  13. // thread cache for |root|.
  14. void SwapOutProcessThreadCacheForTesting(ThreadSafePartitionRoot* root);
  15. // Disables the current thread cache, and replaces it with the default for the
  16. // process.
  17. void SwapInProcessThreadCacheForTesting(ThreadSafePartitionRoot* root);
  18. } // namespace partition_alloc::internal
  19. #endif // BASE_ALLOCATOR_PARTITION_ALLOCATOR_EXTENDED_API_H_