Skip to content

Commit 315d9c9

Browse files
IlyasShabiv8-scoped@luci-project-accounts.iam.gserviceaccount.com
authored andcommitted
Solaris: implement Stack::ObtainCurrentThreadStackReservedLimit
Port 5a54f45 Solaris is excluded from the generic POSIX implementation, so implement the function using pthread_attr_get_np() and pthread_attr_getstack(), consistent with ObtainCurrentThreadStackStart(). The base returned by pthread_attr_getstack() maps to the lowest address of the thread's reserved stack. Change-Id: I08a5b4cd80180b04496b22989cb976d1c24ce8e6 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8413453 Reviewed-by: Michael Lippautz <[email protected]> Reviewed-by: Joyee Cheung <[email protected]> Commit-Queue: Joyee Cheung <[email protected]> Cr-Commit-Position: refs/heads/main@{#109953}
1 parent 502d72f commit 315d9c9

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

‎src/base/platform/platform-solaris.cc‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,5 +89,23 @@ Stack::StackSlot Stack::ObtainCurrentThreadStackStart() {
8989
return nullptr;
9090
}
9191

92+
// static
93+
Stack::StackSlot Stack::ObtainCurrentThreadStackReservedLimit() {
94+
pthread_attr_t attr;
95+
int error;
96+
pthread_attr_init(&attr);
97+
error = pthread_attr_get_np(pthread_self(), &attr);
98+
if (!error) {
99+
void* base;
100+
size_t size;
101+
error = pthread_attr_getstack(&attr, &base, &size);
102+
CHECK(!error);
103+
pthread_attr_destroy(&attr);
104+
return base;
105+
}
106+
pthread_attr_destroy(&attr);
107+
return nullptr;
108+
}
109+
92110
} // namespace base
93111
} // namespace v8

0 commit comments

Comments
 (0)