• Home
  • Raw
  • Download

Lines Matching refs:Primary

24 template <typename Primary> static void testPrimary() {  in testPrimary()
26 auto Deleter = [](Primary *P) { in testPrimary()
30 std::unique_ptr<Primary, decltype(Deleter)> Allocator(new Primary, Deleter); in testPrimary()
32 typename Primary::CacheT Cache; in testPrimary()
36 if (!Primary::canAllocate(Size)) in testPrimary()
38 const scudo::uptr ClassId = Primary::SizeClassMap::getClassIdBySize(Size); in testPrimary()
67 using Primary = scudo::SizeClassAllocator64<scudo::DefaultSizeClassMap, 20U>; in TEST() typedef
68 using TransferBatch = Primary::CacheT::TransferBatch; in TEST()
69 Primary Allocator; in TEST()
71 typename Primary::CacheT Cache; in TEST()
77 const scudo::uptr ClassId = Primary::SizeClassMap::LargestClassId; in TEST()
78 const scudo::uptr Size = Primary::getSizeByClassId(ClassId); in TEST()
102 template <typename Primary> static void testIteratePrimary() { in testIteratePrimary()
103 auto Deleter = [](Primary *P) { in testIteratePrimary()
107 std::unique_ptr<Primary, decltype(Deleter)> Allocator(new Primary, Deleter); in testIteratePrimary()
109 typename Primary::CacheT Cache; in testIteratePrimary()
113 const scudo::uptr Size = std::rand() % Primary::SizeClassMap::MaxSize; in testIteratePrimary()
114 const scudo::uptr ClassId = Primary::SizeClassMap::getClassIdBySize(Size); in testIteratePrimary()
154 template <typename Primary> static void performAllocations(Primary *Allocator) { in performAllocations()
155 static THREADLOCAL typename Primary::CacheT Cache; in performAllocations()
164 const scudo::uptr Size = std::rand() % Primary::SizeClassMap::MaxSize / 4; in performAllocations()
165 const scudo::uptr ClassId = Primary::SizeClassMap::getClassIdBySize(Size); in performAllocations()
178 template <typename Primary> static void testPrimaryThreaded() { in testPrimaryThreaded()
180 auto Deleter = [](Primary *P) { in testPrimaryThreaded()
184 std::unique_ptr<Primary, decltype(Deleter)> Allocator(new Primary, Deleter); in testPrimaryThreaded()
188 Threads[I] = std::thread(performAllocations<Primary>, Allocator.get()); in testPrimaryThreaded()
214 template <typename Primary> static void testReleaseToOS() { in testReleaseToOS()
215 auto Deleter = [](Primary *P) { in testReleaseToOS()
219 std::unique_ptr<Primary, decltype(Deleter)> Allocator(new Primary, Deleter); in testReleaseToOS()
221 typename Primary::CacheT Cache; in testReleaseToOS()
224 EXPECT_TRUE(Primary::canAllocate(Size)); in testReleaseToOS()
225 const scudo::uptr ClassId = Primary::SizeClassMap::getClassIdBySize(Size); in testReleaseToOS()