llvm-project/compiler-rt/lib/scudo/standalone/tests
Kostya Kortchinsky 161cca266a [scudo][standalone] Android related improvements
Summary:
This changes a few things to improve memory footprint and performances
on Android, and fixes a test compilation error:
- add `stdlib.h` to `wrappers_c_test.cc` to address
  https://bugs.llvm.org/show_bug.cgi?id=42810
- change Android size class maps, based on benchmarks, to improve
  performances and lower the Svelte memory footprint. Also change the
  32-bit region size for said configuration
- change the `reallocate` logic to reallocate in place for sizes larger
  than the original chunk size, when they still fit in the same block.
  This addresses patterns from `memory_replay` dumps like the following:
```
202: realloc 0xb48fd000 0xb4930650 12352
202: realloc 0xb48fd000 0xb48fd000 12420
202: realloc 0xb48fd000 0xb48fd000 12492
202: realloc 0xb48fd000 0xb48fd000 12564
202: realloc 0xb48fd000 0xb48fd000 12636
202: realloc 0xb48fd000 0xb48fd000 12708
202: realloc 0xb48fd000 0xb48fd000 12780
202: realloc 0xb48fd000 0xb48fd000 12852
202: realloc 0xb48fd000 0xb48fd000 12924
202: realloc 0xb48fd000 0xb48fd000 12996
202: realloc 0xb48fd000 0xb48fd000 13068
202: realloc 0xb48fd000 0xb48fd000 13140
202: realloc 0xb48fd000 0xb48fd000 13212
202: realloc 0xb48fd000 0xb48fd000 13284
202: realloc 0xb48fd000 0xb48fd000 13356
202: realloc 0xb48fd000 0xb48fd000 13428
202: realloc 0xb48fd000 0xb48fd000 13500
202: realloc 0xb48fd000 0xb48fd000 13572
202: realloc 0xb48fd000 0xb48fd000 13644
202: realloc 0xb48fd000 0xb48fd000 13716
202: realloc 0xb48fd000 0xb48fd000 13788
...
```
  In this situation we were deallocating the old chunk, and
  allocating a new one for every single one of those, but now we can
  keep the same chunk (we just updated the header), which saves some
  heap operations.

Reviewers: hctim, morehouse, vitalybuka, eugenis, cferris, rengolin

Reviewed By: morehouse

Subscribers: srhines, delcypher, #sanitizers, llvm-commits

Tags: #llvm, #sanitizers

Differential Revision: https://reviews.llvm.org/D67293

llvm-svn: 371628
2019-09-11 14:48:41 +00:00
..
CMakeLists.txt compiler-rt: Rename .cc file in lib/scudo/standalone/tests to .cpp 2019-08-01 14:38:49 +00:00
atomic_test.cpp compiler-rt: Rename .cc file in lib/scudo/standalone/tests to .cpp 2019-08-01 14:38:49 +00:00
bytemap_test.cpp compiler-rt: Rename .cc file in lib/scudo/standalone/tests to .cpp 2019-08-01 14:38:49 +00:00
checksum_test.cpp compiler-rt: Rename .cc file in lib/scudo/standalone/tests to .cpp 2019-08-01 14:38:49 +00:00
chunk_test.cpp compiler-rt: Rename .cc file in lib/scudo/standalone/tests to .cpp 2019-08-01 14:38:49 +00:00
combined_test.cpp [scudo][standalone] Android related improvements 2019-09-11 14:48:41 +00:00
flags_test.cpp compiler-rt: Rename .cc file in lib/scudo/standalone/tests to .cpp 2019-08-01 14:38:49 +00:00
list_test.cpp compiler-rt: Rename .cc file in lib/scudo/standalone/tests to .cpp 2019-08-01 14:38:49 +00:00
map_test.cpp compiler-rt: Rename .cc file in lib/scudo/standalone/tests to .cpp 2019-08-01 14:38:49 +00:00
mutex_test.cpp compiler-rt: Rename .cc file in lib/scudo/standalone/tests to .cpp 2019-08-01 14:38:49 +00:00
primary_test.cpp compiler-rt: Rename .cc file in lib/scudo/standalone/tests to .cpp 2019-08-01 14:38:49 +00:00
quarantine_test.cpp compiler-rt: Rename .cc file in lib/scudo/standalone/tests to .cpp 2019-08-01 14:38:49 +00:00
release_test.cpp compiler-rt: Rename .cc file in lib/scudo/standalone/tests to .cpp 2019-08-01 14:38:49 +00:00
report_test.cpp compiler-rt: Rename .cc file in lib/scudo/standalone/tests to .cpp 2019-08-01 14:38:49 +00:00
scudo_unit_test_main.cpp compiler-rt: Rename .cc file in lib/scudo/standalone/tests to .cpp 2019-08-01 14:38:49 +00:00
secondary_test.cpp compiler-rt: Rename .cc file in lib/scudo/standalone/tests to .cpp 2019-08-01 14:38:49 +00:00
size_class_map_test.cpp compiler-rt: Rename .cc file in lib/scudo/standalone/tests to .cpp 2019-08-01 14:38:49 +00:00
stats_test.cpp compiler-rt: Rename .cc file in lib/scudo/standalone/tests to .cpp 2019-08-01 14:38:49 +00:00
strings_test.cpp compiler-rt: Rename .cc file in lib/scudo/standalone/tests to .cpp 2019-08-01 14:38:49 +00:00
tsd_test.cpp compiler-rt: Rename .cc file in lib/scudo/standalone/tests to .cpp 2019-08-01 14:38:49 +00:00
vector_test.cpp compiler-rt: Rename .cc file in lib/scudo/standalone/tests to .cpp 2019-08-01 14:38:49 +00:00
wrappers_c_test.cpp [scudo][standalone] Android related improvements 2019-09-11 14:48:41 +00:00
wrappers_cpp_test.cpp compiler-rt: Rename .cc file in lib/scudo/standalone/tests to .cpp 2019-08-01 14:38:49 +00:00