#include "partition_alloc/memory_reclaimer.h"
#include <memory>
#include <utility>
#include "partition_alloc/build_config.h"
#include "partition_alloc/buildflags.h"
#include "partition_alloc/partition_alloc_base/compiler_specific.h"
#include "partition_alloc/partition_alloc_base/logging.h"
#include "partition_alloc/partition_alloc_config.h"
#include "partition_alloc/partition_alloc_for_testing.h"
#include "partition_alloc/shim/allocator_shim_default_dispatch_to_partition_alloc.h"
#include "testing/gtest/include/gtest/gtest.h"
#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && \
PA_CONFIG(THREAD_CACHE_SUPPORTED)
#include "partition_alloc/extended_api.h"
#include "partition_alloc/thread_cache.h"
#endif
#if !defined(MEMORY_TOOL_REPLACES_ALLOCATOR)
namespace partition_alloc {
namespace {
void HandleOOM(size_t unused_size) { … }
}
class MemoryReclaimerTest : public ::testing::Test { … };
TEST_F(MemoryReclaimerTest, FreesMemory) { … }
TEST_F(MemoryReclaimerTest, Reclaim) { … }
#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && \
PA_CONFIG(THREAD_CACHE_SUPPORTED)
namespace {
PA_NOINLINE void FreeForTest(void* data) { … }
}
TEST_F(MemoryReclaimerTest, DoNotAlwaysPurgeThreadCache) { … }
#endif
}
#endif