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

Unified Diff: runtime/vm/os_thread_macos.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_macos.cc
diff --git a/runtime/vm/os_thread_macos.cc b/runtime/vm/os_thread_macos.cc
index 23fe4d7ca60b20edf593c57db6ac2a7655d02c82..bc33dc1d70231ddc1a2d57a8f188757c3a73bf3b 100644
--- a/runtime/vm/os_thread_macos.cc
+++ b/runtime/vm/os_thread_macos.cc
@@ -209,6 +209,13 @@ bool OSThread::Compare(ThreadId a, ThreadId b) {
}
+bool OSThread::GetCurrentStackBounds(uword* lower, uword* upper) {
+ *upper = reinterpret_cast<uword>(pthread_get_stackaddr_np(pthread_self()));
+ *lower = *upper - pthread_get_stacksize_np(pthread_self());
+ return true;
+}
+
+
Mutex::Mutex() {
pthread_mutexattr_t attr;
int result = pthread_mutexattr_init(&attr);

Powered by Google App Engine
This is Rietveld 408576698