Louis Zhuang
2010-04-09 15:33:05 UTC
Hi, I think solaris specific thr_stksegment is the better API to implement
GC_get_stack_base, which avoids worrying SIGSEV from find_limit(). Please review
following patch.
Cheers, Louis
Index: os_dep.c
===================================================================
--- os_dep.c (revision 23713)
+++ os_dep.c (revision 23718)
@@ -1230,6 +1230,22 @@
#endif /* GC_LINUX_THREADS */
+#if defined(GC_SOLARIS_THREADS)
+
+#include <thread.h>
+#include <signal.h>
+
+int GC_get_stack_base(struct GC_stack_base *b)
+{
+ stack_t s;
+ thr_stksegment(&s);
+ b -> mem_base = s.ss_sp;
+ return GC_SUCCESS;
+}
+#define HAVE_GET_STACK_BASE
+
+#endif /* GC_SOLARIS_THREADS */
+
#ifndef HAVE_GET_STACK_BASE
/* Retrieve stack base. */
/* Using the GC_find_limit version is risky. */
GC_get_stack_base, which avoids worrying SIGSEV from find_limit(). Please review
following patch.
Cheers, Louis
Index: os_dep.c
===================================================================
--- os_dep.c (revision 23713)
+++ os_dep.c (revision 23718)
@@ -1230,6 +1230,22 @@
#endif /* GC_LINUX_THREADS */
+#if defined(GC_SOLARIS_THREADS)
+
+#include <thread.h>
+#include <signal.h>
+
+int GC_get_stack_base(struct GC_stack_base *b)
+{
+ stack_t s;
+ thr_stksegment(&s);
+ b -> mem_base = s.ss_sp;
+ return GC_SUCCESS;
+}
+#define HAVE_GET_STACK_BASE
+
+#endif /* GC_SOLARIS_THREADS */
+
#ifndef HAVE_GET_STACK_BASE
/* Retrieve stack base. */
/* Using the GC_find_limit version is risky. */