diff options
Diffstat (limited to 'js/src/jsnativestack.cpp')
-rw-r--r-- | js/src/jsnativestack.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/js/src/jsnativestack.cpp b/js/src/jsnativestack.cpp index 34131f9667..42c84b2a42 100644 --- a/js/src/jsnativestack.cpp +++ b/js/src/jsnativestack.cpp @@ -8,7 +8,7 @@ #ifdef XP_WIN # include "jswin.h" -#elif defined(XP_UNIX) +#elif defined(XP_DARWIN) || defined(DARWIN) || defined(XP_UNIX) # include <pthread.h> # if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) @@ -127,6 +127,10 @@ void* js::GetNativeStackBaseImpl() { pthread_t thread = pthread_self(); +# if defined(XP_DARWIN) || defined(DARWIN) + return pthread_get_stackaddr_np(thread); + +# else pthread_attr_t sattr; pthread_attr_init(&sattr); # if defined(__OpenBSD__) @@ -166,6 +170,7 @@ js::GetNativeStackBaseImpl() # else return static_cast<char*>(stackBase) + stackSize; # endif +# endif } #endif /* !XP_WIN */ |