Tue Sep 25 14:56:03 CEST 2007 Paolo Molaro <lupus@ximian.com>
authorPaolo Molaro <lupus@oddwiz.org>
Tue, 25 Sep 2007 12:46:48 +0000 (12:46 -0000)
committerPaolo Molaro <lupus@oddwiz.org>
Tue, 25 Sep 2007 12:46:48 +0000 (12:46 -0000)
* threads.c: support OSX and other systems in
mono_thread_get_stack_bounds (bug #328026).

svn path=/trunk/mono/; revision=86319

mono/metadata/ChangeLog
mono/metadata/threads.c

index 9650f15edce8c430765804d11e91a6d797b68a74..0fbc4b5ad93bcbc3cf4900a71b3daabf3c501dda 100644 (file)
@@ -1,3 +1,9 @@
+
+Tue Sep 25 14:56:03 CEST 2007 Paolo Molaro <lupus@ximian.com>
+
+       * threads.c: support OSX and other systems in
+       mono_thread_get_stack_bounds (bug #328026).
+
 2007-09-25  Martin Baulig  <martin@ximian.com>
 
        * mono-debug.h
index 8ae94a39a87734416967033c5ae50a083b7078d6..d05ef760808788a993b037d284f0b9f22472a284 100644 (file)
@@ -651,7 +651,12 @@ void mono_thread_create (MonoDomain *domain, gpointer func, gpointer arg)
 void
 mono_thread_get_stack_bounds (guint8 **staddr, size_t *stsize)
 {
-#ifndef PLATFORM_WIN32
+#if defined(HAVE_PTHREAD_GET_STACKSIZE_NP) && defined(HAVE_PTHREAD_GET_STACKADDR_NP)
+       *staddr = (guint8*)pthread_get_stackaddr_np (pthread_self ());
+       *stsize = pthread_get_stacksize_np (pthread_self ());
+       return;
+       /* FIXME: simplify the mess below */
+#elif !defined(PLATFORM_WIN32)
        pthread_attr_t attr;
        guint8 *current = (guint8*)&attr;