[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
This commit is contained in:
Kuba Mracek 2017-12-14 00:07:15 +00:00
parent eb18bc5d22
commit 2c1fa4feb1
1 changed files with 3 additions and 3 deletions

View File

@ -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) {