summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/scudo/standalone/combined.h
diff options
context:
space:
mode:
authorKostya Kortchinsky <kostyak@google.com>2019-10-29 09:30:50 -0700
committerKostya Kortchinsky <kostyak@google.com>2019-10-30 08:55:58 -0700
commit19ea1d46ccfe7decd623ba3f860d8ba7a9f1bb44 (patch)
tree221e4ec3ccce51cbdba182dd2babadc151c99c94 /compiler-rt/lib/scudo/standalone/combined.h
parent8dcf1c654ed4e95a618868d4fab11af2068a1471 (diff)
downloadbcm5719-llvm-19ea1d46ccfe7decd623ba3f860d8ba7a9f1bb44.tar.gz
bcm5719-llvm-19ea1d46ccfe7decd623ba3f860d8ba7a9f1bb44.zip
[scudo][standalone] Add a free list to the Secondary
Summary: The secondary allocator is slow, because we map and unmap each block on allocation and deallocation. While I really like the security benefits of such a behavior, this yields very disappointing performance numbers on Android for larger allocation benchmarks. So this change adds a free list to the secondary, that will hold recently deallocated chunks, and (currently) release the extraneous memory. This allows to save on some memory mapping operations on allocation and deallocation. I do not think that this lowers the security of the secondary, but can increase the memory footprint a little bit (RSS & VA). The maximum number of blocks the free list can hold is templatable, `0U` meaning that we fallback to the old behavior. The higher that number, the higher the extra memory footprint. I added default configurations for all our platforms, but they are likely to change in the near future based on needs and feedback. Reviewers: hctim, morehouse, cferris, pcc, eugenis, vitalybuka Subscribers: mgorny, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D69570
Diffstat (limited to 'compiler-rt/lib/scudo/standalone/combined.h')
-rw-r--r--compiler-rt/lib/scudo/standalone/combined.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler-rt/lib/scudo/standalone/combined.h b/compiler-rt/lib/scudo/standalone/combined.h
index 60be1dd20d3..dc9c8be342a 100644
--- a/compiler-rt/lib/scudo/standalone/combined.h
+++ b/compiler-rt/lib/scudo/standalone/combined.h
@@ -449,7 +449,7 @@ public:
}
private:
- typedef MapAllocator SecondaryT;
+ using SecondaryT = typename Params::Secondary;
typedef typename PrimaryT::SizeClassMap SizeClassMap;
static const uptr MinAlignmentLog = SCUDO_MIN_ALIGNMENT_LOG;
OpenPOWER on IntegriCloud