Lines Matching refs:scudo

22   for (scudo::uptr I = 0; I < SCUDO_WORDSIZE; I++) {  in TEST()
24 scudo::PackedCounterArray Counters2N(1U, 1U, 1UL << I); in TEST()
25 EXPECT_EQ(sizeof(scudo::uptr), Counters2N.getBufferSize()); in TEST()
27 scudo::PackedCounterArray Counters2N1_1(1U, 1U, ~0UL >> I); in TEST()
28 EXPECT_EQ(sizeof(scudo::uptr), Counters2N1_1.getBufferSize()); in TEST()
31 scudo::PackedCounterArray Counters(1U, SCUDO_WORDSIZE, 1UL << I); in TEST()
32 EXPECT_EQ(sizeof(scudo::uptr) * scudo::roundUpToPowerOfTwo(I + 1), in TEST()
37 for (scudo::uptr I = 0; (SCUDO_WORDSIZE >> I) != 0; I++) { in TEST()
39 const scudo::uptr NumCounters = in TEST()
40 (scudo::getPageSizeCached() / 8) * (SCUDO_WORDSIZE >> I); in TEST()
41 scudo::PackedCounterArray Counters(1U, NumCounters, in TEST()
44 for (scudo::uptr C = 1; C < NumCounters - 1; C++) { in TEST()
53 for (scudo::uptr C = 0; C < NumCounters; C++) in TEST()
64 : PageSizeScaledLog(scudo::getLog2(scudo::getPageSizeCached())) {} in StringRangeRecorder()
66 void releasePageRangeToOS(scudo::uptr From, scudo::uptr To) { in releasePageRangeToOS()
78 const scudo::uptr PageSizeScaledLog;
79 scudo::uptr LastPageReported = 0;
101 typedef scudo::FreePagesRangeTracker<StringRangeRecorder> RangeTracker; in TEST()
106 for (scudo::uptr I = 0; TestCase[I] != 0; I++) in TEST()
120 std::set<scudo::uptr> ReportedPages;
122 void releasePageRangeToOS(scudo::uptr From, scudo::uptr To) { in releasePageRangeToOS()
123 const scudo::uptr PageSize = scudo::getPageSizeCached(); in releasePageRangeToOS()
124 for (scudo::uptr I = From; I < To; I += PageSize) in releasePageRangeToOS()
131 static const scudo::u32 MaxCount = SizeClassMap::MaxNumCachedHint;
133 void add(scudo::uptr P) { in add()
137 scudo::u32 getCount() const { return Count; } in getCount()
138 scudo::uptr get(scudo::u32 I) const { in get()
145 scudo::u32 Count;
146 scudo::uptr Batch[MaxCount];
151 const scudo::uptr PagesCount = 1024; in testReleaseFreeMemoryToOS()
152 const scudo::uptr PageSize = scudo::getPageSizeCached(); in testReleaseFreeMemoryToOS()
154 scudo::u32 RandState = 42; in testReleaseFreeMemoryToOS()
156 for (scudo::uptr I = 1; I <= SizeClassMap::LargestClassId; I++) { in testReleaseFreeMemoryToOS()
157 const scudo::uptr BlockSize = SizeClassMap::getSizeByClassId(I); in testReleaseFreeMemoryToOS()
158 const scudo::uptr MaxBlocks = PagesCount * PageSize / BlockSize; in testReleaseFreeMemoryToOS()
161 std::vector<scudo::uptr> FreeArray; in testReleaseFreeMemoryToOS()
163 scudo::uptr CurrentRangeEnd = 0; in testReleaseFreeMemoryToOS()
164 for (scudo::uptr I = 0; I < MaxBlocks; I++) { in testReleaseFreeMemoryToOS()
166 InFreeRange = (scudo::getRandomU32(&RandState) & 1U) == 1; in testReleaseFreeMemoryToOS()
167 CurrentRangeEnd += (scudo::getRandomU32(&RandState) & 0x7f) + 1; in testReleaseFreeMemoryToOS()
178 scudo::SinglyLinkedList<Batch> FreeList; in testReleaseFreeMemoryToOS()
193 auto SkipRegion = [](UNUSED scudo::uptr RegionIndex) { return false; }; in testReleaseFreeMemoryToOS()
201 scudo::uptr VerifiedReleasedPages = 0; in testReleaseFreeMemoryToOS()
202 std::set<scudo::uptr> FreeBlocks(FreeArray.begin(), FreeArray.end()); in testReleaseFreeMemoryToOS()
204 scudo::uptr CurrentBlock = 0; in testReleaseFreeMemoryToOS()
206 scudo::uptr CurrentFreeRangeStart = 0; in testReleaseFreeMemoryToOS()
207 for (scudo::uptr I = 0; I < MaxBlocks; I++) { in testReleaseFreeMemoryToOS()
217 const scudo::uptr StartPage = CurrentBlock / PageSize; in testReleaseFreeMemoryToOS()
218 const scudo::uptr EndPage = (CurrentBlock + BlockSize - 1) / PageSize; in testReleaseFreeMemoryToOS()
219 for (scudo::uptr J = StartPage; J <= EndPage; J++) { in testReleaseFreeMemoryToOS()
229 scudo::uptr P = scudo::roundUpTo(CurrentFreeRangeStart, PageSize); in testReleaseFreeMemoryToOS()
244 scudo::uptr P = scudo::roundUpTo(CurrentFreeRangeStart, PageSize); in testReleaseFreeMemoryToOS()
245 const scudo::uptr EndPage = in testReleaseFreeMemoryToOS()
246 scudo::roundUpTo(MaxBlocks * BlockSize, PageSize); in testReleaseFreeMemoryToOS()
267 testReleaseFreeMemoryToOS<scudo::DefaultSizeClassMap>(); in TEST()
271 testReleaseFreeMemoryToOS<scudo::AndroidSizeClassMap>(); in TEST()
275 testReleaseFreeMemoryToOS<scudo::SvelteSizeClassMap>(); in TEST()