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

Unified Diff: runtime/vm/os_thread_android.cc

Issue 2680123004: VM: Teach GetAndValidateIsolateStackBounds(...) to fallback to OS thread stack bounds. (Closed)
Patch Set: Done Created 3 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/os_thread_android.cc
diff --git a/runtime/vm/os_thread_android.cc b/runtime/vm/os_thread_android.cc
index 29823b8ccc13395ba3047077fe9f4723ad29ee0b..3ad2a891fcad7fe0ccecba00afd1e5dce6cdd300 100644
--- a/runtime/vm/os_thread_android.cc
+++ b/runtime/vm/os_thread_android.cc
@@ -234,6 +234,26 @@ bool OSThread::Compare(ThreadId a, ThreadId b) {
}
+bool OSThread::GetCurrentStackBounds(uword* lower, uword* upper) {
+ pthread_attr_t attr;
+ if (pthread_getattr_np(pthread_self(), &attr)) {
+ return false;
+ }
+
+ void* base;
+ size_t size;
+ int error = pthread_attr_getstack(&attr, &base, &size);
+ pthread_attr_destroy(&attr);
+ if (error) {
+ return false;
+ }
+
+ *lower = reinterpret_cast<uword>(base);
+ *upper = *lower + size;
+ return true;
+}
+
+
Mutex::Mutex() {
pthread_mutexattr_t attr;
int result = pthread_mutexattr_init(&attr);
« no previous file with comments | « runtime/vm/os_thread.h ('k') | runtime/vm/os_thread_fuchsia.cc » ('j') | runtime/vm/profiler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698