diff options
author | Kuba Mracek <mracek@apple.com> | 2017-12-14 00:07:15 +0000 |
---|---|---|
committer | Kuba Mracek <mracek@apple.com> | 2017-12-14 00:07:15 +0000 |
commit | 2c1fa4feb183b7168d98f5dba8984b9dfde4ab31 (patch) | |
tree | 2064f7dbcb8fa1e879b2328fe2963dbec5e90d01 | |
parent | eb18bc5d2223372544834cc858237b4ebd29101a (diff) | |
download | bcm5719-llvm-2c1fa4feb183b7168d98f5dba8984b9dfde4ab31.tar.gz bcm5719-llvm-2c1fa4feb183b7168d98f5dba8984b9dfde4ab31.zip |
[asan] Use linker initialization for the allocator
This saves ~2 MB of dirty memory footprint. Can be a big deal on mobile devices especially when running multiple processes with ASan.
Differential Revision: https://reviews.llvm.org/D40627
llvm-svn: 320660
-rw-r--r-- | compiler-rt/lib/asan/asan_allocator.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler-rt/lib/asan/asan_allocator.cc b/compiler-rt/lib/asan/asan_allocator.cc index bc9b896f91e..a437ae1cd3b 100644 --- a/compiler-rt/lib/asan/asan_allocator.cc +++ b/compiler-rt/lib/asan/asan_allocator.cc @@ -274,9 +274,9 @@ struct Allocator { atomic_store(&max_redzone, options.max_redzone, memory_order_release); } - void Initialize(const AllocatorOptions &options) { + void InitLinkerInitialized(const AllocatorOptions &options) { SetAllocatorMayReturnNull(options.may_return_null); - allocator.Init(options.release_to_os_interval_ms); + allocator.InitLinkerInitialized(options.release_to_os_interval_ms); SharedInitCode(options); } @@ -817,7 +817,7 @@ StackTrace AsanChunkView::GetFreeStack() const { } void InitializeAllocator(const AllocatorOptions &options) { - instance.Initialize(options); + instance.InitLinkerInitialized(options); } void ReInitializeAllocator(const AllocatorOptions &options) { |