ptr_t GC_approx_sp()
{
- word dummy;
-
+#if defined(__GNUC__)
+ return __builtin_frame_address(0);
+#else
+ VOLATILE word dummy;
+
+ dummy = 42; /* Force stack to grow if necessary. Otherwise the */
+ /* later accesses might cause the kernel to think we're */
+ /* doing something wrong. */
# ifdef _MSC_VER
# pragma warning(disable:4172)
# endif
# ifdef _MSC_VER
# pragma warning(default:4172)
# endif
+#endif // __GNUC__
}
/*