summaryrefslogtreecommitdiff
path: root/lib/scudo/standalone/primary64.h
diff options
context:
space:
mode:
authorKostya Kortchinsky <kostyak@google.com>2019-07-11 19:55:53 +0000
committerKostya Kortchinsky <kostyak@google.com>2019-07-11 19:55:53 +0000
commit5ec1a38f6ce0aeca2fbd4a79cac4ef10aef061a5 (patch)
tree2de88d363b0d3fe4f20164b0d84e0db6ac64e4bc /lib/scudo/standalone/primary64.h
parent449e644b30b34b5ec2bd5d264663268d8bb5971a (diff)
downloadcompiler-rt-5ec1a38f6ce0aeca2fbd4a79cac4ef10aef061a5.tar.gz
[scudo][standalone] NFC corrections
Summary: A few corrections: - rename `TransferBatch::MaxCached` to `getMaxCached` to conform with the style guide; - move `getBlockBegin` from `Chunk::` to `Allocator::`: I believe it was a fallacy to have this be a `Chunk` method, as chunks' relationship to backend blocks are up to the frontend allocator. It makes more sense now, particularly with regard to the offset. Update the associated chunk test as the method isn't available there anymore; - add a forgotten `\n` to a log string; - for `releaseToOs`, instead of starting at `1`, start at `0` and `continue` on `BatchClassId`: in the end it's identical but doesn't assume a particular class id for batches; - change a `CHECK` to a `reportOutOfMemory`: it's a clearer message Reviewers: hctim, morehouse, eugenis, vitalybuka Reviewed By: hctim Subscribers: delcypher, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D64570 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365816 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/scudo/standalone/primary64.h')
-rw-r--r--lib/scudo/standalone/primary64.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/scudo/standalone/primary64.h b/lib/scudo/standalone/primary64.h
index 89a43cce3..035182b33 100644
--- a/lib/scudo/standalone/primary64.h
+++ b/lib/scudo/standalone/primary64.h
@@ -166,7 +166,9 @@ public:
}
void releaseToOS() {
- for (uptr I = 1; I < NumClasses; I++) {
+ for (uptr I = 0; I < NumClasses; I++) {
+ if (I == SizeClassMap::BatchClassId)
+ continue;
RegionInfo *Region = getRegionInfo(I);
ScopedLock L(Region->Mutex);
releaseToOSMaybe(Region, I, /*Force=*/true);
@@ -249,7 +251,7 @@ private:
NOINLINE TransferBatch *populateFreeList(CacheT *C, uptr ClassId,
RegionInfo *Region) {
const uptr Size = getSizeByClassId(ClassId);
- const u32 MaxCount = TransferBatch::MaxCached(Size);
+ const u32 MaxCount = TransferBatch::getMaxCached(Size);
const uptr RegionBeg = Region->RegionBeg;
const uptr MappedUser = Region->MappedUser;