[PATCH] D40627: [asan] Use linker initialization for the allocator

Kuba (Brecka) Mracek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 30 11:53:48 PST 2017


kubamracek updated this revision to Diff 124984.
kubamracek added a comment.

Ah, sorry. `linker_initialized` should of course be "true".


https://reviews.llvm.org/D40627

Files:
  lib/asan/asan_allocator.cc


Index: lib/asan/asan_allocator.cc
===================================================================
--- lib/asan/asan_allocator.cc
+++ lib/asan/asan_allocator.cc
@@ -274,9 +274,12 @@
     atomic_store(&max_redzone, options.max_redzone, memory_order_release);
   }
 
-  void Initialize(const AllocatorOptions &options) {
+  void Initialize(const AllocatorOptions &options, bool linker_initialized) {
     SetAllocatorMayReturnNull(options.may_return_null);
-    allocator.Init(options.release_to_os_interval_ms);
+    if (linker_initialized)
+      allocator.InitLinkerInitialized(options.release_to_os_interval_ms);
+    else
+      allocator.Init(options.release_to_os_interval_ms);
     SharedInitCode(options);
   }
 
@@ -817,7 +820,7 @@
 }
 
 void InitializeAllocator(const AllocatorOptions &options) {
-  instance.Initialize(options);
+  instance.Initialize(options, /*linker_initialized*/ true);
 }
 
 void ReInitializeAllocator(const AllocatorOptions &options) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40627.124984.patch
Type: text/x-patch
Size: 972 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171130/a9607f5b/attachment.bin>


More information about the llvm-commits mailing list