[Mono-dev] Get the correct stackbottom in boehm-gc.c on OpenBSD

Robert Nagy robert at openbsd.org
Fri Apr 16 04:09:15 EDT 2010


Please commit to trunk and branch-2-6 too.
Thanks
-------------- next part --------------
Index: metadata/boehm-gc.c
===================================================================
--- metadata/boehm-gc.c (revision 155566)
+++ metadata/boehm-gc.c (working copy)
@@ -85,6 +85,17 @@
        }
 #elif defined(HAVE_PTHREAD_GET_STACKSIZE_NP) && defined(HAVE_PTHREAD_GET_STACKADDR_NP)
                GC_stackbottom = (char*)pthread_get_stackaddr_np (pthread_self ());
+#elif defined(__OpenBSD__)
+#  include <pthread_np.h>
+       {
+               stack_t ss;
+               int rslt;
+
+               rslt = pthread_stackseg_np(pthread_self(), &ss);
+               g_assert (rslt == 0);
+
+               GC_stackbottom = (char*)ss.ss_sp;
+       }
 #else
        {
                int dummy;


More information about the Mono-devel-list mailing list