summaryrefslogtreecommitdiff
path: root/lib/asan/asan_allocator.cc
diff options
context:
space:
mode:
authorKuba Mracek <mracek@apple.com>2017-12-14 00:07:15 +0000
committerKuba Mracek <mracek@apple.com>2017-12-14 00:07:15 +0000
commitac69c8ffbd47b598ae780ad37169b830118d9346 (patch)
treebb81712fe3865edd7bfb36c7670a296eefc237c2 /lib/asan/asan_allocator.cc
parentf097a8484d5a2c0732108351440984b93fdaa13d (diff)
[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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320660 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/asan_allocator.cc')
-rw-r--r--lib/asan/asan_allocator.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/asan/asan_allocator.cc b/lib/asan/asan_allocator.cc
index bc9b896f9..a437ae1cd 100644
--- a/lib/asan/asan_allocator.cc
+++ b/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) {