[PATCH] D43949: [scudo] Secondary allocator overhaul to support Windows

Kostya Kortchinsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 1 09:12:55 PST 2018


cryptoad created this revision.
cryptoad added a reviewer: alekseyshl.
Herald added subscribers: Sanitizers, delcypher.

The need for this change stems from the fact that Windows doesn't support
partial unmapping (`MEM_RELEASE` implies the entire allocated region). So we
now have to keep track of the reserved region and the committed region, so that
we can function without the trimming we did when dealing with larger alignments.

Instead of just having a `ReservedAddressRange` per chunk, we introduce a
`LargeChunkHeader` (and `LargeChunk` namespace) that additionally holds the
committed size and the usable size. The former is needed for stats purposes,
the latter is used by the frontend. Requiring both is debatable, we could only
work with the usable size but then be off by up to a page per chunk when
dealing with stats.

Additionally, we introduce more stats since they turned out to be useful for
experiments, and a `PrintStats` function that will be used by the combined
allocator in later patch.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D43949

Files:
  lib/scudo/scudo_allocator_combined.h
  lib/scudo/scudo_allocator_secondary.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43949.136550.patch
Type: text/x-patch
Size: 9065 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180301/86f5f6f4/attachment.bin>


More information about the llvm-commits mailing list