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 | d398471a634d421cdccb0d792762f7f85a06f2de (patch) | |
tree | 2c5358a9e1210429e1a1df1cc9a85cf2e4c19afe /compiler-rt/test/hwasan | |
parent | ef4afca2add8fdec49466229028662ead54d47e6 (diff) | |
download | bcm5719-llvm-d398471a634d421cdccb0d792762f7f85a06f2de.tar.gz bcm5719-llvm-d398471a634d421cdccb0d792762f7f85a06f2de.zip |
[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
llvm-svn: 350370
Diffstat (limited to 'compiler-rt/test/hwasan')
-rw-r--r-- | compiler-rt/test/hwasan/TestCases/heap-buffer-overflow.c | 1 | ||||
-rw-r--r-- | compiler-rt/test/hwasan/TestCases/use-after-free.c | 2 |
2 files changed, 1 insertions, 2 deletions
diff --git a/compiler-rt/test/hwasan/TestCases/heap-buffer-overflow.c b/compiler-rt/test/hwasan/TestCases/heap-buffer-overflow.c index bff39d293d8..9f605b3208d 100644 --- a/compiler-rt/test/hwasan/TestCases/heap-buffer-overflow.c +++ b/compiler-rt/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/compiler-rt/test/hwasan/TestCases/use-after-free.c b/compiler-rt/test/hwasan/TestCases/use-after-free.c index fcdd0771c37..03a1771c1b8 100644 --- a/compiler-rt/test/hwasan/TestCases/use-after-free.c +++ b/compiler-rt/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: |