diff options
author | ChiaHungDuan <chiahungduan@google.com> | 2024-04-25 19:40:40 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2024-04-25 19:46:22 -0700 |
commit | af1c12f2243bc722addc1ad303479d525ee42525 (patch) | |
tree | 1d22e72ae3c5680f9936369a56ff4412ad942feb | |
parent | 654039be90606a740e7aa341ec8c91cdbe57ed6b (diff) | |
download | scudo-af1c12f2243bc722addc1ad303479d525ee42525.tar.gz |
[scudo] Fix the misused Exhausted in region allocation (#89852)
`Region->Exhausted` indicates that we don't have more pages to create
new blocks in the region. It has different meaning from region
allocation failure.
Also fix a minor lint in popBlocks()
GitOrigin-RevId: c7f4b3e1bd5cab43d6f733a5107b2946c76bc0bb
Change-Id: I73081d4b3b6823d98d8279cea2014d323c064bd2
-rw-r--r-- | standalone/primary64.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/standalone/primary64.h b/standalone/primary64.h index 61d57976ae4..d6119051b16 100644 --- a/standalone/primary64.h +++ b/standalone/primary64.h @@ -884,9 +884,10 @@ private: ScopedLock ML(Region->MMLock); const bool RegionIsExhausted = Region->Exhausted; - if (!RegionIsExhausted) + if (!RegionIsExhausted) { PopCount = populateFreeListAndPopBlocks(C, ClassId, Region, ToArray, MaxBlockCount); + } ReportRegionExhausted = !RegionIsExhausted && Region->Exhausted; { @@ -1019,7 +1020,6 @@ private: MAP_ALLOWNOMEM))) { Printf("Can't reserve pages for size class %zu.\n", getSizeByClassId(ClassId)); - Region->Exhausted = true; return 0U; } initRegion(Region, ClassId, |