diff options
author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2019-01-03 23:19:02 +0000 |
---|---|---|
committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2019-01-03 23:19:02 +0000 |
commit | dd450bfaa3e6536930ca17aee4c8f3835c1c9626 (patch) | |
tree | e6693984e3fef78b19d66b66d5b786e5042607ed /test | |
parent | c680622ffe7a6802167ca3387fb5c14673bd235d (diff) | |
download | compiler-rt-dd450bfaa3e6536930ca17aee4c8f3835c1c9626.tar.gz |
[hwasan] Switch to 64 allocator with a dense size class map.
Summary:
Replace the 32-bit allocator with a 64-bit one with a non-constant
base address, and reduce both the number of size classes and the maximum
size of per-thread caches.
As measured on [1], this reduces average weighted memory overhead
(MaxRSS) from 26% to 12% over stock android allocator. These numbers
include overhead from code instrumentation and hwasan shadow (i.e. not a
pure allocator benchmark).
This switch also enables release-to-OS functionality, which is not
implemented in the 32-bit allocator. I have not seen any effect from
that on the benchmark.
[1] https://android.googlesource.com/platform/system/extras/+/master/memory_replay/
Reviewers: vitalybuka, kcc
Subscribers: kubamracek, cryptoad, llvm-commits
Differential Revision: https://reviews.llvm.org/D56239
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350370 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/hwasan/TestCases/heap-buffer-overflow.c | 1 | ||||
-rw-r--r-- | test/hwasan/TestCases/use-after-free.c | 2 |
2 files changed, 1 insertions, 2 deletions
diff --git a/test/hwasan/TestCases/heap-buffer-overflow.c b/test/hwasan/TestCases/heap-buffer-overflow.c index bff39d293..9f605b320 100644 --- a/test/hwasan/TestCases/heap-buffer-overflow.c +++ b/test/hwasan/TestCases/heap-buffer-overflow.c @@ -43,7 +43,6 @@ int main(int argc, char **argv) { // CHECK80-RIGHT: allocated heap chunk; size: 32 offset: // CHECK80-RIGHT: is located 50 bytes to the right of 30-byte region // -// CHECKm30: allocated heap chunk; size: 32 offset: 2 // CHECKm30: is located 30 bytes to the left of 30-byte region // // CHECKMm30: is a large allocated heap chunk; size: 1003520 offset: -30 diff --git a/test/hwasan/TestCases/use-after-free.c b/test/hwasan/TestCases/use-after-free.c index fcdd0771c..03a1771c1 100644 --- a/test/hwasan/TestCases/use-after-free.c +++ b/test/hwasan/TestCases/use-after-free.c @@ -23,7 +23,7 @@ int main() { // CHECK: [[TYPE]] of size 1 at {{.*}} tags: [[PTR_TAG:[0-9a-f][0-9a-f]]]/[[MEM_TAG:[0-9a-f][0-9a-f]]] (ptr/mem) // CHECK: #0 {{.*}} in main {{.*}}use-after-free.c:[[@LINE-2]] // Offset is 5 or 11 depending on left/right alignment. - // CHECK: is a small unallocated heap chunk; size: 16 offset: {{5|11}} + // CHECK: is a small unallocated heap chunk; size: 32 offset: {{5|11}} // CHECK: is located 5 bytes inside of 10-byte region // // CHECK: freed by thread {{.*}} here: |