summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/sanitizer_common/sanitizer_allocator.cc
diff options
context:
space:
mode:
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>2016-11-29 00:22:50 +0000
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>2016-11-29 00:22:50 +0000
commitd3305afc757513e9a9db6cd70d5b9631e1806b44 (patch)
treeb2bb9aa74158032f301b0cd7bec3d6bdcd1aa7e6 /compiler-rt/lib/sanitizer_common/sanitizer_allocator.cc
parentb9e53c9056fad09fb5e1a5b61ab4b7acffd8d6ad (diff)
downloadbcm5719-llvm-d3305afc757513e9a9db6cd70d5b9631e1806b44.tar.gz
bcm5719-llvm-d3305afc757513e9a9db6cd70d5b9631e1806b44.zip
Return memory to OS right after free (not in the async thread).
Summary: In order to avoid starting a separate thread to return unused memory to the system (the thread interferes with process startup on Android, Zygota waits for all threads to exit before fork, but this thread never exits), try to return it right after free. Reviewers: eugenis Subscribers: cryptoad, filcab, danalbert, kubabrecka, llvm-commits Patch by Aleksey Shlyapnikov. Differential Revision: https://reviews.llvm.org/D27003 llvm-svn: 288091
Diffstat (limited to 'compiler-rt/lib/sanitizer_common/sanitizer_allocator.cc')
-rw-r--r--compiler-rt/lib/sanitizer_common/sanitizer_allocator.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_allocator.cc b/compiler-rt/lib/sanitizer_common/sanitizer_allocator.cc
index 5c10f69d6fa..d47b5b41413 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_allocator.cc
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_allocator.cc
@@ -94,7 +94,8 @@ InternalAllocator *internal_allocator() {
SpinMutexLock l(&internal_alloc_init_mu);
if (atomic_load(&internal_allocator_initialized, memory_order_relaxed) ==
0) {
- internal_allocator_instance->Init(/* may_return_null*/ false);
+ internal_allocator_instance->Init(
+ /* may_return_null */ false, kReleaseToOSIntervalNever);
atomic_store(&internal_allocator_initialized, 1, memory_order_release);
}
}
OpenPOWER on IntegriCloud