- // FIXME: Unift with mono_thread_get_stack_bounds ()
- /* try to get it with attributes first */
-#if (defined(HAVE_PTHREAD_GETATTR_NP) || defined(HAVE_PTHREAD_ATTR_GET_NP)) && defined(HAVE_PTHREAD_ATTR_GETSTACK)
- {
- size_t size;
- void *sstart;
- pthread_attr_t attr;
-
-#if defined(HAVE_PTHREAD_GETATTR_NP)
- /* Linux */
- pthread_getattr_np (pthread_self (), &attr);
-#elif defined(HAVE_PTHREAD_ATTR_GET_NP)
- /* BSD */
- pthread_attr_init (&attr);
- pthread_attr_get_np (pthread_self (), &attr);
-#else
-#error Cannot determine which API is needed to retrieve pthread attributes.
+ /* On win32, stack_start_limit should be 0, since the stack can grow dynamically */
+#ifndef HOST_WIN32
+ mono_thread_info_get_stack_bounds (&staddr, &stsize);