Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(434)

Side by Side Diff: base/threading/platform_thread_android.cc

Issue 136113006: Increase default stack size on Android with ASan to 2Mb. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/threading/platform_thread.h" 5 #include "base/threading/platform_thread.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <sys/resource.h> 8 #include <sys/resource.h>
9 9
10 #include "base/android/jni_android.h" 10 #include "base/android/jni_android.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 // where they were created. This sets all new threads to the default. 88 // where they were created. This sets all new threads to the default.
89 PlatformThread::SetThreadPriority(PlatformThread::CurrentHandle(), 89 PlatformThread::SetThreadPriority(PlatformThread::CurrentHandle(),
90 kThreadPriority_Normal); 90 kThreadPriority_Normal);
91 } 91 }
92 92
93 void TerminateOnThread() { 93 void TerminateOnThread() {
94 base::android::DetachFromVM(); 94 base::android::DetachFromVM();
95 } 95 }
96 96
97 size_t GetDefaultThreadStackSize(const pthread_attr_t& attributes) { 97 size_t GetDefaultThreadStackSize(const pthread_attr_t& attributes) {
98 #if !defined(ADDRESS_SANITIZER)
98 return 0; 99 return 0;
100 #else
101 // AddressSanitizer bloats the stack approximately 2x. Default stack size of
102 // 1Mb is not enough for some tests (see http://crbug.com/263749 for example).
103 return 2 * (1 << 20); // 2Mb
Alexander Potapenko 2014/01/27 14:54:51 Two spaces before the comment, please.
eugenis 2014/01/27 15:14:30 Done.
104 #endif
99 } 105 }
100 106
101 bool RegisterThreadUtils(JNIEnv* env) { 107 bool RegisterThreadUtils(JNIEnv* env) {
102 return RegisterNativesImpl(env); 108 return RegisterNativesImpl(env);
103 } 109 }
104 110
105 } // namespace base 111 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698