Lines Matching full:region

29 // Region actually starts at a random offset from its base.
36 // The 1st Region (for size class 0) holds the TransferBatches. This is a
71 RegionInfo *Region = getRegionInfo(I); in initLinkerInitialized() local
72 // The actual start of a region is offseted by a random number of pages. in initLinkerInitialized()
73 Region->RegionBeg = in initLinkerInitialized()
75 Region->RandState = getRandomU32(&Seed); in initLinkerInitialized()
76 Region->ReleaseInfo.LastReleaseAtNs = Time; in initLinkerInitialized()
91 RegionInfo *Region = getRegionInfo(ClassId); in popBatch() local
92 ScopedLock L(Region->Mutex); in popBatch()
93 TransferBatch *B = Region->FreeList.front(); in popBatch()
95 Region->FreeList.pop_front(); in popBatch()
97 B = populateFreeList(C, ClassId, Region); in popBatch()
102 Region->Stats.PoppedBlocks += B->getCount(); in popBatch()
108 RegionInfo *Region = getRegionInfo(ClassId); in pushBatch() local
109 ScopedLock L(Region->Mutex); in pushBatch()
110 Region->FreeList.push_front(B); in pushBatch()
111 Region->Stats.PushedBlocks += B->getCount(); in pushBatch()
113 releaseToOSMaybe(Region, ClassId); in pushBatch()
139 const RegionInfo *Region = getRegionInfo(I); in iterateOverBlocks() local
141 const uptr From = Region->RegionBeg; in iterateOverBlocks()
142 const uptr To = From + Region->AllocatedUser; in iterateOverBlocks()
149 // TODO(kostyak): get the RSS per region. in getStats()
154 RegionInfo *Region = getRegionInfo(I); in getStats() local
155 if (Region->MappedUser) in getStats()
156 TotalMapped += Region->MappedUser; in getStats()
157 PoppedBlocks += Region->Stats.PoppedBlocks; in getStats()
158 PushedBlocks += Region->Stats.PushedBlocks; in getStats()
186 RegionInfo *Region = getRegionInfo(I); in releaseToOS() local
187 ScopedLock L(Region->Mutex); in releaseToOS()
188 TotalReleasedBytes += releaseToOSMaybe(Region, I, /*Force=*/true); in releaseToOS()
326 RegionInfo *Region) { in populateFreeList() argument
330 const uptr RegionBeg = Region->RegionBeg; in populateFreeList()
331 const uptr MappedUser = Region->MappedUser; in populateFreeList()
332 const uptr TotalUserBytes = Region->AllocatedUser + MaxCount * Size; in populateFreeList()
340 if (!Region->Exhausted) { in populateFreeList()
341 Region->Exhausted = true; in populateFreeList()
352 Region->Data = Data; in populateFreeList()
358 &Region->Data))) in populateFreeList()
360 Region->MappedUser += MapSize; in populateFreeList()
366 static_cast<u32>((Region->MappedUser - Region->AllocatedUser) / Size)); in populateFreeList()
375 uptr P = RegionBeg + Region->AllocatedUser; in populateFreeList()
380 shuffle(ShuffleArray, NumberOfBlocks, &Region->RandState); in populateFreeList()
389 Region->FreeList.push_back(B); in populateFreeList()
392 TransferBatch *B = Region->FreeList.front(); in populateFreeList()
393 Region->FreeList.pop_front(); in populateFreeList()
399 Region->AllocatedUser += AllocatedUser; in populateFreeList()
405 RegionInfo *Region = getRegionInfo(ClassId); in getStats() local
406 if (Region->MappedUser == 0) in getStats()
408 const uptr InUse = Region->Stats.PoppedBlocks - Region->Stats.PushedBlocks; in getStats()
409 const uptr TotalChunks = Region->AllocatedUser / getSizeByClassId(ClassId); in getStats()
412 "released: %6zuK region: 0x%zx (0x%zx)\n", in getStats()
413 Region->Exhausted ? "F" : " ", ClassId, in getStats()
414 getSizeByClassId(ClassId), Region->MappedUser >> 10, in getStats()
415 Region->Stats.PoppedBlocks, Region->Stats.PushedBlocks, InUse, in getStats()
416 TotalChunks, Rss >> 10, Region->ReleaseInfo.RangesReleased, in getStats()
417 Region->ReleaseInfo.LastReleasedBytes >> 10, Region->RegionBeg, in getStats()
421 NOINLINE uptr releaseToOSMaybe(RegionInfo *Region, uptr ClassId,
426 DCHECK_GE(Region->Stats.PoppedBlocks, Region->Stats.PushedBlocks);
428 Region->AllocatedUser -
429 (Region->Stats.PoppedBlocks - Region->Stats.PushedBlocks) * BlockSize;
432 const uptr BytesPushed = (Region->Stats.PushedBlocks -
433 Region->ReleaseInfo.PushedBlocksAtLastRelease) *
442 if (!Force && BytesPushed < Region->AllocatedUser / 16U)
445 if ((BytesInFreeList * 100U) / Region->AllocatedUser <
454 if (Region->ReleaseInfo.LastReleaseAtNs +
461 ReleaseRecorder Recorder(Region->RegionBeg, &Region->Data);
467 releaseFreeMemoryToOS(Region->FreeList, Region->AllocatedUser, 1U,
471 Region->ReleaseInfo.PushedBlocksAtLastRelease =
472 Region->Stats.PushedBlocks;
473 Region->ReleaseInfo.RangesReleased += Recorder.getReleasedRangesCount();
474 Region->ReleaseInfo.LastReleasedBytes = Recorder.getReleasedBytes();
476 Region->ReleaseInfo.LastReleaseAtNs = getMonotonicTime();